Don't crash when drawing one-character static strings.
[GB.SDL2] * BUG: Don't crash when drawing one-character static strings.
This commit is contained in:
parent
23a8fbc81d
commit
388bc70157
2 changed files with 4 additions and 2 deletions
|
@ -327,6 +327,8 @@ BEGIN_METHOD(Draw_Image, GB_OBJECT image; GB_INTEGER x; GB_INTEGER y; GB_INTEGER
|
|||
else
|
||||
rect = NULL;
|
||||
|
||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||
|
||||
if (MISSING(opacity) && MISSING(angle))
|
||||
SDL_RenderCopy(RENDERER, texture, rect, &dest);
|
||||
else
|
||||
|
|
|
@ -245,9 +245,9 @@ SDL_Image *FONT_render_text(CFONT *_object, CWINDOW *window, char *text, int len
|
|||
{
|
||||
SDL_Color color = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
char c = text[len];
|
||||
text[len] = 0;
|
||||
if (c) text[len] = 0;
|
||||
surface = TTF_RenderUTF8_Blended(THIS->font, text, color);
|
||||
text[len] = c;
|
||||
if (c) text[len] = c;
|
||||
*w = surface->w;
|
||||
*h = surface->h;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue