Fix for deleting the last uncommit character

This commit is contained in:
Jjgod Jiang 2010-08-12 16:00:47 +02:00
parent 819cc95139
commit 43cd4e54ac
2 changed files with 8 additions and 4 deletions

View file

@ -144,6 +144,8 @@
{
[_markedText release];
_markedText = nil;
SDL_SendEditingText("", 0, 0);
}
- (NSRect) firstRectForCharacterRange: (NSRange) theRange

View file

@ -136,11 +136,13 @@ static void RenderText(SDL_Surface *sur,
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