diff options
author | Paul Gilbert | 2011-12-08 10:59:48 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-12-08 10:59:48 +1100 |
commit | 481ebbf2d9636c3114d41b65f1e278acbcc1f399 (patch) | |
tree | 2e55f95e4dca4663401315fb77838680d2ed60a9 | |
parent | 5ab404f5bae87b6aac031232259ead2b3cf6386b (diff) | |
download | scummvm-rg350-481ebbf2d9636c3114d41b65f1e278acbcc1f399.tar.gz scummvm-rg350-481ebbf2d9636c3114d41b65f1e278acbcc1f399.tar.bz2 scummvm-rg350-481ebbf2d9636c3114d41b65f1e278acbcc1f399.zip |
TSAGE: Bugfix to correctly horizontally center text in R2R
-rw-r--r-- | engines/tsage/core.cpp | 8 |
1 files 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; |