[Scummvm-cvs-logs] scummvm master -> 481ebbf2d9636c3114d41b65f1e278acbcc1f399
dreammaster
dreammaster at scummvm.org
Thu Dec 8 01:00:36 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
481ebbf2d9 TSAGE: Bugfix to correctly horizontally center text in R2R
Commit: 481ebbf2d9636c3114d41b65f1e278acbcc1f399
https://github.com/scummvm/scummvm/commit/481ebbf2d9636c3114d41b65f1e278acbcc1f399
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-12-07T15:59:48-08:00
Commit Message:
TSAGE: Bugfix to correctly horizontally center text in R2R
Changed paths:
engines/tsage/core.cpp
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 0ad1c43..6a84b25 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;
More information about the Scummvm-git-logs
mailing list