[Scummvm-cvs-logs] SF.net SVN: scummvm:[46264] scummvm/trunk/engines/teenagent/scene.cpp

megath at users.sourceforge.net megath at users.sourceforge.net
Sat Dec 5 07:03:25 CET 2009


Revision: 46264
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46264&view=rev
Author:   megath
Date:     2009-12-05 06:03:24 +0000 (Sat, 05 Dec 2009)

Log Message:
-----------
fixed multiline message positioning

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/scene.cpp

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-12-05 06:00:00 UTC (rev 46263)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-12-05 06:03:24 UTC (rev 46264)
@@ -971,8 +971,13 @@
 
 Common::Point Scene::messagePosition(const Common::String &str, Common::Point position) {
 	Resources *res = Resources::instance();
+	int lines = 1;
+	for(uint i = 0; i < str.size(); ++i)
+		if (str[i] == '\n')
+			++lines;
+
 	uint w = res->font7.render(NULL, 0, 0, str, 0);
-	uint h = res->font7.height + 3;
+	uint h = res->font7.height * lines + 3;
 
 	position.x -= w / 2;
 	position.y -= h;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list