mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-19 13:41:11 +00:00
(svn r25771) -Fix (r25344): If story book content changed height due a string parameter changing length, the scrollbar was not updated
This commit is contained in:
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…
Reference in New Issue
Block a user