From e55ec6c6ca414b919916363515c7a71e54eaf8e4 Mon Sep 17 00:00:00 2001 From: Abdeselam El-Haman Date: Fri, 25 Mar 2016 02:34:35 +0100 Subject: GUI: Widget: redraw when setAlign() called --- gui/widget.cpp | 14 +++++++++++--- 1 file 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); + } + } -- cgit v1.2.3