From 481ebbf2d9636c3114d41b65f1e278acbcc1f399 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 8 Dec 2011 10:59:48 +1100 Subject: TSAGE: Bugfix to correctly horizontally center text in R2R --- engines/tsage/core.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 0ad1c43e8c..6a84b2521b 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1675,10 +1675,14 @@ void SceneItem::display(int resNum, int lineNum, ...) { if (resNum) { // Get required bounding size - g_globals->gfxManager().getStringBounds(msg.c_str(), textRect, maxWidth); - textRect.center(pos.x, pos.y); + GfxFont font; + font.setFontNumber(g_globals->_sceneText._fontNumber); + font.getStringBounds(msg.c_str(), textRect, maxWidth); + // Center the text at the specified position, and then constrain it to be- + textRect.center(pos.x, pos.y); textRect.contain(g_globals->gfxManager()._bounds); + if (centerText) { g_globals->_sceneText._color1 = g_globals->_sceneText._color2; g_globals->_sceneText._color2 = 0; -- cgit v1.2.3