Commit 43cd4e54 authored by Jjgod Jiang's avatar Jjgod Jiang

Fix for deleting the last uncommit character

parent 819cc951
...@@ -144,6 +144,8 @@ ...@@ -144,6 +144,8 @@
{ {
[_markedText release]; [_markedText release];
_markedText = nil; _markedText = nil;
SDL_SendEditingText("", 0, 0);
} }
- (NSRect) firstRectForCharacterRange: (NSRange) theRange - (NSRect) firstRectForCharacterRange: (NSRange) theRange
......
...@@ -136,11 +136,13 @@ static void RenderText(SDL_Surface *sur, ...@@ -136,11 +136,13 @@ static void RenderText(SDL_Surface *sur,
int x, int y, int x, int y,
SDL_Color color) SDL_Color color)
{ {
SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); if (text && strlen(text)) {
SDL_Rect dest = { x, y, textSur->w, textSur->h }; 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_BlitSurface(textSur, NULL, sur, &dest);
SDL_FreeSurface(textSur); SDL_FreeSurface(textSur);
}
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment