diff options
author | Martin Kiewitz | 2010-07-30 16:08:27 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-07-30 16:08:27 +0000 |
commit | 6dd5dfb7d0aa7e1d64f2e49ed3017dcceef6dbb1 (patch) | |
tree | 405869f7c2b77ad89c56e716ffa7eb34c9b9b8f0 /engines | |
parent | c785645123493b8087a869e9f96e645898d51bfc (diff) | |
download | scummvm-rg350-6dd5dfb7d0aa7e1d64f2e49ed3017dcceef6dbb1.tar.gz scummvm-rg350-6dd5dfb7d0aa7e1d64f2e49ed3017dcceef6dbb1.tar.bz2 scummvm-rg350-6dd5dfb7d0aa7e1d64f2e49ed3017dcceef6dbb1.zip |
SCI: fixing font code handling in kTextSize
fixes incorrect window proportions in sq5 when hailing ship at clorox II
svn-id: r51511
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/text16.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 08be203230..61737cad05 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -233,9 +233,6 @@ int16 GfxText16::GetLongest(const char *text, int16 maxWidth, GuiResourceId orgF void GfxText16::Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) { uint16 curChar; - GuiResourceId oldFontId = GetFontId(); - int16 oldPenColor = _ports->_curPort->penClr; - textWidth = 0; textHeight = 0; GetFont(); @@ -264,13 +261,17 @@ void GfxText16::Width(const char *text, int16 from, int16 len, GuiResourceId org } } } - SetFont(oldFontId); - _ports->penColor(oldPenColor); return; } void GfxText16::StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) { + GuiResourceId oldFontId = GetFontId(); + int16 oldPenColor = _ports->_curPort->penClr; + Width(str, 0, (int16)strlen(str), orgFontId, textWidth, textHeight); + + SetFont(oldFontId); + _ports->penColor(oldPenColor); } void GfxText16::ShowString(const char *str, GuiResourceId orgFontId, int16 orgPenColor) { |