# HG changeset patch # User zuu # Date 2013-09-14 12:18:36 # Node ID 972a168f27dec0ed95386520987f2a312f81c51d # Parent 8b7b2fb2c00e6d6d6180d226b2d97f956e8cb629 (svn r25771) -Fix (r25344): If story book content changed height due a string parameter changing length, the scrollbar was not updated diff --git a/src/story_gui.cpp b/src/story_gui.cpp --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -479,6 +479,21 @@ public: } } + virtual void OnPaint() + { + /* Detect if content has changed height. This can happen if a + * multi-line text contains eg. {COMPANY} and that company is + * renamed. + */ + if (this->vscroll->GetCount() != this->GetContentHeight()) { + this->vscroll->SetCount(this->GetContentHeight()); + this->SetWidgetDirty(WID_SB_SCROLLBAR); + this->SetWidgetDirty(WID_SB_PAGE_PANEL); + } + + this->DrawWidgets(); + } + virtual void DrawWidget(const Rect &r, int widget) const { if (widget != WID_SB_PAGE_PANEL) return;