[Scummvm-git-logs] scummvm master -> 9e5d0c770046f65cf80c54fd6b16b349a216040c
dreammaster
noreply at scummvm.org
Sun Dec 19 03:06:28 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9e5d0c7700 SHERLOCK: Calculate font height/width more accurately
Commit: 9e5d0c770046f65cf80c54fd6b16b349a216040c
https://github.com/scummvm/scummvm/commit/9e5d0c770046f65cf80c54fd6b16b349a216040c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-12-18T19:06:26-08:00
Commit Message:
SHERLOCK: Calculate font height/width more accurately
Each character in a font can have an X and Y offset. This was not
considered when calculating the width and height of the font. One way
this could be noticed was in Serrated Scalpel, when talking to a
character with a lot of conversation options. Scrolling down would
highlight the "Up" button. Selecting a conversation option would then
dim the button, but the bottommost pixel of the "p" was still
highlighted.
Hopefully this does not negatively affect anything else.
Changed paths:
engines/sherlock/fonts.cpp
diff --git a/engines/sherlock/fonts.cpp b/engines/sherlock/fonts.cpp
index 8efe66067b..b42f9f4533 100644
--- a/engines/sherlock/fonts.cpp
+++ b/engines/sherlock/fonts.cpp
@@ -131,8 +131,8 @@ void Fonts::setFont(int fontNum) {
// Iterate through the frames to find the widest and tallest font characters
_fontHeight = _widestChar = 0;
for (uint idx = 0; idx < MIN<uint>(_charCount, 128 - 32); ++idx) {
- _fontHeight = MAX((int16)_fontHeight, (*_font)[idx]._frame.h);
- _widestChar = MAX((int16)_widestChar, (*_font)[idx]._frame.w);
+ _fontHeight = MAX(_fontHeight, (*_font)[idx]._frame.h + (*_font)[idx]._offset.y);
+ _widestChar = MAX(_widestChar, (*_font)[idx]._frame.w + (*_font)[idx]._offset.x);
}
// Initialize the Y offset table for the extended character set
More information about the Scummvm-git-logs
mailing list