From ce749cd44cfab0f5a75cfdd8b96a14f5c3ea1b68 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 19 May 2006 22:41:51 +0000 Subject: Call handleScreenChanged() *before* calling setEditString(). Otherwise _leftPadding may be wrong, or even undefined, when getEditRect() is called, which may cause ScummVM to trigger an "invalid rect" assertion. svn-id: r22536 --- gui/EditTextWidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp index 5499d655fe..277b69bc74 100644 --- a/gui/EditTextWidget.cpp +++ b/gui/EditTextWidget.cpp @@ -32,9 +32,8 @@ EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, cons _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE; _type = kEditTextWidget; - setEditString(text); - handleScreenChanged(); + setEditString(text); } EditTextWidget::EditTextWidget(GuiObject *boss, String name, const String &text) @@ -43,9 +42,8 @@ EditTextWidget::EditTextWidget(GuiObject *boss, String name, const String &text) _type = kEditTextWidget; _hints |= THEME_HINT_USE_SHADOW; - setEditString(text); - handleScreenChanged(); + setEditString(text); } void EditTextWidget::setEditString(const String &str) { -- cgit v1.2.3