diff options
author | Matthew Hoops | 2012-03-08 10:07:58 -0500 |
---|---|---|
committer | Matthew Hoops | 2012-03-08 10:07:58 -0500 |
commit | b71dffafbe438a5cea887ae3f72ef76dd5d00cd9 (patch) | |
tree | 250fac28106e60d406923b96a55b0bebe88e8c31 /engines/sci/graphics | |
parent | fe0c5c0e9720c30689b745ff7aee136022c3df8d (diff) | |
download | scummvm-rg350-b71dffafbe438a5cea887ae3f72ef76dd5d00cd9.tar.gz scummvm-rg350-b71dffafbe438a5cea887ae3f72ef76dd5d00cd9.tar.bz2 scummvm-rg350-b71dffafbe438a5cea887ae3f72ef76dd5d00cd9.zip |
SCI: Fix GK1 Mac text positioning
A regression from the text bitmap code addition
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/text32.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index e24799f6b8..7894c7109c 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -297,6 +297,10 @@ int16 GfxText32::Size(Common::Rect &rect, const char *text, GuiResourceId fontId int16 maxTextWidth = 0, textWidth; int16 totalHeight = 0, textHeight; + // Adjust maxWidth if we're using an upscaled font + if (_screen->fontIsUpscaled()) + maxWidth = maxWidth * _screen->getDisplayWidth() / _screen->getWidth(); + rect.top = rect.left = 0; GfxFont *font = _cache->getFont(fontId); @@ -323,6 +327,14 @@ int16 GfxText32::Size(Common::Rect &rect, const char *text, GuiResourceId fontId rect.bottom = totalHeight; rect.right = maxWidth ? maxWidth : MIN(rect.right, maxTextWidth); } + + // Adjust the width/height if we're using an upscaled font + // for the scripts + if (_screen->fontIsUpscaled()) { + rect.right = rect.right * _screen->getWidth() / _screen->getDisplayWidth(); + rect.bottom = rect.bottom * _screen->getHeight() / _screen->getDisplayHeight(); + } + return rect.right; } |