GUI: Widget: redraw when setAlign() called

This commit is contained in:
Abdeselam El-Haman 2016-03-25 02:34:35 +01:00
parent 60b763bd4c
commit e55ec6c6ca

View File

@ -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);
}
}