aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdeselam El-Haman2016-03-25 02:34:35 +0100
committerAbdeselam El-Haman2016-03-25 02:34:35 +0100
commite55ec6c6ca414b919916363515c7a71e54eaf8e4 (patch)
treedc25b8ae8de6f5acb11f7a5fc52ee553de37b29b
parent60b763bd4cc5e8bcbd5638ade0e414ff7c75d2c5 (diff)
downloadscummvm-rg350-e55ec6c6ca414b919916363515c7a71e54eaf8e4.tar.gz
scummvm-rg350-e55ec6c6ca414b919916363515c7a71e54eaf8e4.tar.bz2
scummvm-rg350-e55ec6c6ca414b919916363515c7a71e54eaf8e4.zip
GUI: Widget: redraw 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 851774fd70..9f98298224 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -263,9 +263,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);
+ }
+
}