[Scummvm-cvs-logs] SF.net SVN: scummvm:[51268] scummvm/trunk/gui/ThemeEngine.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Jul 25 00:54:56 CEST 2010


Revision: 51268
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51268&view=rev
Author:   sev
Date:     2010-07-24 22:54:56 +0000 (Sat, 24 Jul 2010)

Log Message:
-----------
GUI: Fix overdrawn tabs

If tabs are scrolled, do not draw those which are supposed to be invisible.

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeEngine.cpp

Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp	2010-07-24 22:32:08 UTC (rev 51267)
+++ scummvm/trunk/gui/ThemeEngine.cpp	2010-07-24 22:54:56 UTC (rev 51268)
@@ -1067,12 +1067,16 @@
 		if (i == active)
 			continue;
 
+		if (r.left + i * tabWidth > r.right || r.left + (i + 1) * tabWidth > r.right)
+			continue;
+
 		Common::Rect tabRect(r.left + i * tabWidth, r.top, r.left + (i + 1) * tabWidth, r.top + tabHeight);
 		queueDD(kDDTabInactive, tabRect);
 		queueDDText(getTextData(kDDTabInactive), getTextColor(kDDTabInactive), tabRect, tabs[i], false, false, _widgets[kDDTabInactive]->_textAlignH, _widgets[kDDTabInactive]->_textAlignV);
 	}
 
-	if (active >= 0) {
+	if (active >= 0 &&
+			(r.left + active * tabWidth < r.right) && (r.left + (active + 1) * tabWidth < r.right)) {
 		Common::Rect tabRect(r.left + active * tabWidth, r.top, r.left + (active + 1) * tabWidth, r.top + tabHeight);
 		const uint16 tabLeft = active * tabWidth;
 		const uint16 tabRight =  MAX(r.right - tabRect.right, 0);


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