diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-27 22:43:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-27 23:15:06 +0300 |
commit | dba24b2e59eb739e73228dbcf707e943905a9e5a (patch) | |
tree | bdbcca13bb984a47fd4f1f41d0429244777e10e9 /src/gui | |
parent | ef5ba77247a2860a201c4d9177c4f3479d53538a (diff) | |
download | plus-dba24b2e59eb739e73228dbcf707e943905a9e5a.tar.gz plus-dba24b2e59eb739e73228dbcf707e943905a9e5a.tar.bz2 plus-dba24b2e59eb739e73228dbcf707e943905a9e5a.tar.xz plus-dba24b2e59eb739e73228dbcf707e943905a9e5a.zip |
Fix text size if it was not power of two.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/sdlfont.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index d195278fa..3ece4b849 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -82,6 +82,8 @@ class SDLTextChunk final SDL_Surface *surface = TTF_RenderUTF8_Blended( font, strBuf, sdlCol); + const int width = surface->w; + const int height = surface->h; if (!surface) { @@ -96,7 +98,7 @@ class SDLTextChunk final SDL_Color sdlCol2; const SDL_PixelFormat * const format = surface->format; SDL_Surface *background = imageHelper->create32BitSurface( - surface->w, surface->h); + width, height); if (!background) { img = nullptr; @@ -138,7 +140,8 @@ class SDLTextChunk final SDL_FreeSurface(surface2); surface = background; } - img = imageHelper->createTextSurface(surface, alpha); + img = imageHelper->createTextSurface( + surface, width, height, alpha); SDL_FreeSurface(surface); BLOCK_END("SDLTextChunk::generate") |