aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-07-24 22:54:56 +0000
committerEugene Sandulenko2010-07-24 22:54:56 +0000
commitccbb12b1cbcf1221c0464c5d46a7cefb38420781 (patch)
tree2e3f6eb79e032109d64e967952e38ab92bb60f9e /gui/ThemeEngine.cpp
parentd88ffa13416ace695eb217541e57031c92d9bde6 (diff)
downloadscummvm-rg350-ccbb12b1cbcf1221c0464c5d46a7cefb38420781.tar.gz
scummvm-rg350-ccbb12b1cbcf1221c0464c5d46a7cefb38420781.tar.bz2
scummvm-rg350-ccbb12b1cbcf1221c0464c5d46a7cefb38420781.zip
GUI: Fix overdrawn tabs
If tabs are scrolled, do not draw those which are supposed to be invisible. svn-id: r51268
Diffstat (limited to 'gui/ThemeEngine.cpp')
-rw-r--r--gui/ThemeEngine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 874df9e947..b491b12065 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1067,12 +1067,16 @@ void ThemeEngine::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, co
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);