diff options
-rw-r--r-- | graphics/fonts/ttf.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp index faf59a9ec5..06231799ce 100644 --- a/graphics/fonts/ttf.cpp +++ b/graphics/fonts/ttf.cpp @@ -323,7 +323,6 @@ void TTFFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const int h = glyph.image.h; const uint8 *srcPos = (const uint8 *)glyph.image.getBasePtr(0, 0); - uint8 *dstPos = (uint8 *)dst->getBasePtr(x, y); // Make sure we are not drawing outside the screen bounds if (x < 0) { @@ -350,6 +349,8 @@ void TTFFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const if (h <= 0) return; + uint8 *dstPos = (uint8 *)dst->getBasePtr(x, y); + if (dst->format.bytesPerPixel == 1) { for (int cy = 0; cy < h; ++cy) { uint8 *rDst = dstPos; |