aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-05-16 10:09:09 +0200
committerEugene Sandulenko2016-05-16 10:09:09 +0200
commitb46bb554442f4ead6dd26ee46195e636d55fcc06 (patch)
tree3caca3c2ede6d87ac66bcc85d662cc30c3945601
parent2cd0a99e2bc28fa8ec17f782405c4abfd047f5e1 (diff)
parente55ec6c6ca414b919916363515c7a71e54eaf8e4 (diff)
downloadscummvm-rg350-b46bb554442f4ead6dd26ee46195e636d55fcc06.tar.gz
scummvm-rg350-b46bb554442f4ead6dd26ee46195e636d55fcc06.tar.bz2
scummvm-rg350-b46bb554442f4ead6dd26ee46195e636d55fcc06.zip
Merge pull request #722 from Abde-/master
GUI: Redraw Widget when setAlign() called
-rw-r--r--gui/widget.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 03540f7b91..dda44604c8 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -265,9 +265,17 @@ void StaticTextWidget::setLabel(const Common::String &label) {
}
void StaticTextWidget::setAlign(Graphics::TextAlign align) {
- _align = align;
- // TODO: We should automatically redraw when the alignment is changed.
- // See setLabel() for more insights.
+ if (_align != align){
+ _align = align;
+
+ // same as setLabel() actually, the text
+ // would be redrawn on top of the old one so
+ // we add the CLEARBG flag
+ setFlags(WIDGET_CLEARBG);
+ draw();
+ clearFlags(WIDGET_CLEARBG);
+ }
+
}