summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/sdlfont.cpp7
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")