From b71dffafbe438a5cea887ae3f72ef76dd5d00cd9 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 8 Mar 2012 10:07:58 -0500 Subject: SCI: Fix GK1 Mac text positioning A regression from the text bitmap code addition --- engines/sci/graphics/text32.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; } -- cgit v1.2.3