(svn r25771) -Fix (r25344): If story book content changed height due a string parameter changing length, the scrollbar was not updated

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
zuu 11 years ago
parent 7adc453473
commit f8f9e30f80

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

Loading…
Cancel
Save