diff options
author | Abdeselam El-Haman | 2016-03-25 02:34:35 +0100 |
---|---|---|
committer | Abdeselam El-Haman | 2016-03-25 02:34:35 +0100 |
commit | e55ec6c6ca414b919916363515c7a71e54eaf8e4 (patch) | |
tree | dc25b8ae8de6f5acb11f7a5fc52ee553de37b29b | |
parent | 60b763bd4cc5e8bcbd5638ade0e414ff7c75d2c5 (diff) | |
download | scummvm-rg350-e55ec6c6ca414b919916363515c7a71e54eaf8e4.tar.gz scummvm-rg350-e55ec6c6ca414b919916363515c7a71e54eaf8e4.tar.bz2 scummvm-rg350-e55ec6c6ca414b919916363515c7a71e54eaf8e4.zip |
GUI: Widget: redraw when setAlign() called
-rw-r--r-- | gui/widget.cpp | 14 |
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); + } + } |