diff options
| author | Willem Jan Palenstijn | 2006-06-24 12:27:07 +0000 |
|---|---|---|
| committer | Willem Jan Palenstijn | 2006-06-24 12:27:07 +0000 |
| commit | dc41d02ac73109add30a3456bc44d558f29d2f8d (patch) | |
| tree | 492407505bcbdba4239d7b27800661c3222ef34f /graphics | |
| parent | c673860d0e095a206e2503a19690a4f73c1b2cf7 (diff) | |
| download | scummvm-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
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/font.cpp | 5 |
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) |
