[Scummvm-git-logs] scummvm master -> 296b42b2c0325f0e3fad754878ad771a1cfc0837
npjg
nathanael.gentrydb8 at gmail.com
Thu Jul 16 04:28:07 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
296b42b2c0 GRAPHICS: MACGUI: Don't redundantly clear text surface
Commit: 296b42b2c0325f0e3fad754878ad771a1cfc0837
https://github.com/scummvm/scummvm/commit/296b42b2c0325f0e3fad754878ad771a1cfc0837
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-16T00:27:37-04:00
Commit Message:
GRAPHICS: MACGUI: Don't redundantly clear text surface
This fixes the issue in Director where text redrawing would overwrite the button
indication. Now, the changed-area clearance in MacText::render is the only
clearance of the text surface that occurs.
The contentIsDirty setting is removed from MacButton because this flag is
already reset in MacText::draw.
Changed paths:
graphics/macgui/macbutton.cpp
graphics/macgui/mactext.cpp
diff --git a/graphics/macgui/macbutton.cpp b/graphics/macgui/macbutton.cpp
index 1b6d67a5d6..88091b02da 100644
--- a/graphics/macgui/macbutton.cpp
+++ b/graphics/macgui/macbutton.cpp
@@ -57,6 +57,7 @@ MacButton::MacButton(MacButtonType buttonType, TextAlign textAlignment, MacWidge
_alignOffset.x += offset;
_dims.right += offset;
_composeSurface->create(_dims.width(), _dims.height());
+ _composeSurface->clear(_bgcolor);
}
void MacButton::setActive(bool active) {
@@ -130,7 +131,6 @@ bool MacButton::draw(bool forceRedraw) {
break;
}
- _contentIsDirty = false;
return true;
}
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 083700237f..0b44fb19a9 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -211,6 +211,7 @@ MacText::MacText(const Common::String &s, MacWindowManager *wm, const MacFont *m
void MacText::init() {
_defaultFormatting.wm = _wm;
_currentFormatting = _defaultFormatting;
+ _composeSurface->clear(_bgcolor);
splitString(_str);
recalcDims();
@@ -851,7 +852,6 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int
}
bool MacText::draw(bool forceRedraw) {
-
if (!_contentIsDirty && !_cursorDirty && !forceRedraw)
return false;
@@ -860,8 +860,7 @@ bool MacText::draw(bool forceRedraw) {
return false;
}
- _composeSurface->clear(_bgcolor);
-
+ // TODO: Clear surface fully when background colour changes.
_contentIsDirty = false;
_cursorDirty = false;
More information about the Scummvm-git-logs
mailing list