diff options
Diffstat (limited to 'engines/sherlock/tattoo/widget_text.cpp')
-rw-r--r-- | engines/sherlock/tattoo/widget_text.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sherlock/tattoo/widget_text.cpp b/engines/sherlock/tattoo/widget_text.cpp index a29cd2700f..b9653e371a 100644 --- a/engines/sherlock/tattoo/widget_text.cpp +++ b/engines/sherlock/tattoo/widget_text.cpp @@ -56,14 +56,14 @@ void WidgetText::load(const Common::String &str, int speaker) { // See if it's only a single line long if (height == _surface.fontHeight() + 10) { width = _surface.widestChar() * 2 + 6; - + const char *strP = str.c_str(); while (*strP && (*strP < talk._opcodes[OP_SWITCH_SPEAKER] || *strP == talk._opcodes[OP_NULL])) width += _surface.charWidth(*strP++); } _bounds = Common::Rect(width, height); - + if (speaker == -1) { // No speaker specified, so center window on look position _bounds.translate(ui._lookPos.x - width / 2, ui._lookPos.y - height / 2); @@ -89,11 +89,11 @@ void WidgetText::centerWindowOnSpeaker(int speaker) { int scaleVal = scene.getScaleVal(people[HOLMES]._position); if (scaleVal == SCALE_THRESHOLD) { pt.x += people[HOLMES].frameWidth() / 2; - pt.y = people[HOLMES]._position.y / FIXED_INT_MULTIPLIER - people[HOLMES].frameHeight() + pt.y = people[HOLMES]._position.y / FIXED_INT_MULTIPLIER - people[HOLMES].frameHeight() - _bounds.height() - _surface.fontHeight(); } else { pt.x += people[HOLMES]._imageFrame->sDrawXSize(scaleVal) / 2; - pt.y = people[HOLMES]._position.y / FIXED_INT_MULTIPLIER - people[HOLMES]._imageFrame->sDrawYSize(scaleVal) + pt.y = people[HOLMES]._position.y / FIXED_INT_MULTIPLIER - people[HOLMES]._imageFrame->sDrawYSize(scaleVal) - _bounds.height() - _surface.fontHeight(); } } else { |