[Scummvm-cvs-logs] SF.net SVN: scummvm:[55682] scummvm/trunk/engines/gob/draw_v2.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Mon Jan 31 14:29:19 CET 2011


Revision: 55682
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55682&view=rev
Author:   drmccoy
Date:     2011-01-31 13:29:19 +0000 (Mon, 31 Jan 2011)

Log Message:
-----------
GOB: Fix text end positons for non-monospaced fonts

Fixes Adibou's recipices.

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw_v2.cpp

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2011-01-31 13:28:55 UTC (rev 55681)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2011-01-31 13:29:19 UTC (rev 55682)
@@ -447,9 +447,12 @@
 				}
 			}
 
-			rectLeft = _fonts[_fontIndex]->getCharWidth();
+			rectLeft = 0;
+			for (int i = 0; i < strPosBak; i++)
+				rectLeft += _fonts[_fontIndex]->getCharWidth(str[i]);
+
 			adjustCoords(1, &rectLeft, 0);
-			offX += strPosBak * rectLeft;
+			offX += rectLeft;
 			strPos = 0;
 			strPos2 = -1;
 			memset(mask, 0, 80);


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