[Scummvm-cvs-logs] SF.net SVN: scummvm:[44376] scummvm/trunk/engines/draci/surface.cpp
dkasak13 at users.sourceforge.net
dkasak13 at users.sourceforge.net
Sat Sep 26 15:47:33 CEST 2009
Revision: 44376
http://scummvm.svn.sourceforge.net/scummvm/?rev=44376&view=rev
Author: dkasak13
Date: 2009-09-26 13:47:32 +0000 (Sat, 26 Sep 2009)
Log Message:
-----------
draci: Fixed bug in Surface::centerOn{X,Y}() which made it return a negative coordinate for strings that are too long. Resolves the crash caused by the English data files containing strings which are improperly line-breaked. Ideally, the engine should do the line-breaking itself when the string does not fit.
Modified Paths:
--------------
scummvm/trunk/engines/draci/surface.cpp
Modified: scummvm/trunk/engines/draci/surface.cpp
===================================================================
--- scummvm/trunk/engines/draci/surface.cpp 2009-09-26 13:17:11 UTC (rev 44375)
+++ scummvm/trunk/engines/draci/surface.cpp 2009-09-26 13:47:32 UTC (rev 44376)
@@ -144,6 +144,9 @@
if (newX + width >= (uint)w - 1)
newX = (w - 1) - width;
+ if (newX < 0)
+ newX = 0;
+
return newX;
}
@@ -165,6 +168,9 @@
if (newY + height >= (uint)h - 1)
newY = (h - 1) - height;
+ if (newY < 0)
+ newY = 0;
+
return newY;
}
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