Changeset - r20728:972a168f27de
[Not reviewed]
master
0 1 0
zuu - 11 years ago 2013-09-14 12:18:36
zuu@openttd.org
(svn r25771) -Fix (r25344): If story book content changed height due a string parameter changing length, the scrollbar was not updated
1 file changed with 15 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/story_gui.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)