aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2006-06-24 12:27:07 +0000
committerWillem Jan Palenstijn2006-06-24 12:27:07 +0000
commitdc41d02ac73109add30a3456bc44d558f29d2f8d (patch)
tree492407505bcbdba4239d7b27800661c3222ef34f
parentc673860d0e095a206e2503a19690a4f73c1b2cf7 (diff)
downloadscummvm-rg350-dc41d02ac73109add30a3456bc44d558f29d2f8d.tar.gz
scummvm-rg350-dc41d02ac73109add30a3456bc44d558f29d2f8d.tar.bz2
scummvm-rg350-dc41d02ac73109add30a3456bc44d558f29d2f8d.zip
fix character clipping as mentioned by Marcus on the mailing list on 22 june
svn-id: r23292
-rw-r--r--graphics/font.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/graphics/font.cpp b/graphics/font.cpp
index c1304bd35b..2a452123b8 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -82,11 +82,12 @@ void NewFont::drawChar(Surface *dst, byte chr, int tx, int ty, uint32 color) con
const bitmap_t buffer = READ_UINT16(tmp);
tmp++;
bitmap_t mask = 0x8000;
- if (ty + y < 0 || ty + y >= dst->h)
+ if (ty + desc.ascent - bby - bbh + y < 0 ||
+ ty + desc.ascent - bby - bbh + y >= dst->h)
continue;
for (int x = 0; x < bbw; x++, mask >>= 1) {
- if (tx + x < 0 || tx + x >= dst->w)
+ if (tx + bbx + x < 0 || tx + bbx + x >= dst->w)
continue;
if ((buffer & mask) != 0) {
if (dst->bytesPerPixel == 1)