# HG changeset patch # User Jjgod Jiang # Date 1281621647 -7200 # Node ID 8c229370ddbacaeced0e20a539ba606ea750edcb # Parent b196d27580262e7300dc79701b4b38e85081f6aa Fix for deleting the last uncommit character diff -r b196d2758026 -r 8c229370ddba src/video/cocoa/SDL_cocoakeyboard.m --- a/src/video/cocoa/SDL_cocoakeyboard.m Mon Aug 16 09:04:55 2010 -0700 +++ b/src/video/cocoa/SDL_cocoakeyboard.m Thu Aug 12 16:00:47 2010 +0200 @@ -144,6 +144,8 @@ { [_markedText release]; _markedText = nil; + + SDL_SendEditingText("", 0, 0); } - (NSRect) firstRectForCharacterRange: (NSRange) theRange diff -r b196d2758026 -r 8c229370ddba test/testime.c --- a/test/testime.c Mon Aug 16 09:04:55 2010 -0700 +++ b/test/testime.c Thu Aug 12 16:00:47 2010 +0200 @@ -136,11 +136,13 @@ int x, int y, SDL_Color color) { - SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); - SDL_Rect dest = { x, y, textSur->w, textSur->h }; + if (text && strlen(text)) { + SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); + SDL_Rect dest = { x, y, textSur->w, textSur->h }; - SDL_BlitSurface(textSur, NULL, sur, &dest); - SDL_FreeSurface(textSur); + SDL_BlitSurface(textSur, NULL, sur, &dest); + SDL_FreeSurface(textSur); + } } #endif