[Scummvm-git-logs] scummvm master -> 7be89a3abc8627a399e98f2f9485a1e4ec1b4333
lephilousophe
noreply at scummvm.org
Sun Apr 26 10:04:55 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b49cb8e61f GRAPHICS: Don't call Font::drawChar if the char is too far left
7be89a3abc GRAPHICS: Fix BDF font rendering when x is negative
Commit: b49cb8e61f73444c48652f4ca4da4450aef089ff
https://github.com/scummvm/scummvm/commit/b49cb8e61f73444c48652f4ca4da4450aef089ff
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-26T11:55:32+02:00
Commit Message:
GRAPHICS: Don't call Font::drawChar if the char is too far left
The call will be a noop as the font code is epxected to not write if the
right of the char is negative.
Changed paths:
graphics/font.cpp
diff --git a/graphics/font.cpp b/graphics/font.cpp
index 5b4f7144fc1..3408c16824b 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -115,7 +115,7 @@ void drawStringImpl(const Font &font, SurfaceType *dst, const StringType &str, i
// ever change something here we will need to change it there too.
assert(dst != 0);
- const int leftX = x, rightX = x + w + 1;
+ const int leftX = MAX<int>(x, 0), rightX = x + w + 1;
int width = font.getStringWidth(str);
if (align == kTextAlignCenter)
Commit: 7be89a3abc8627a399e98f2f9485a1e4ec1b4333
https://github.com/scummvm/scummvm/commit/7be89a3abc8627a399e98f2f9485a1e4ec1b4333
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-26T11:55:32+02:00
Commit Message:
GRAPHICS: Fix BDF font rendering when x is negative
Changed paths:
graphics/fonts/bdf.cpp
diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index 48035e356df..24e3764c0f7 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -96,7 +96,7 @@ void drawCharIntern(byte *ptr, uint pitch, const byte *src, int h, int width, in
data = *src++;
if (x >= minX && x <= maxX && (data & 0x80))
- dst[x] = color;
+ dst[x - minX] = color;
data <<= 1;
}
More information about the Scummvm-git-logs
mailing list