Changeset - r26358:2f264f08aba5
[Not reviewed]
master
0 1 0
Peter Nelson - 2 years ago 2022-09-06 16:44:01
peter1138@openttd.org
Fix: Update news window viewport if GUI zoom is changed.
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/news_gui.cpp
Show inline comments
 
@@ -520,6 +520,18 @@ struct NewsWindow : Window {
 
		}
 
	}
 

	
 
	void OnResize() override
 
	{
 
		if (this->viewport != nullptr) {
 
			NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_N_VIEWPORT);
 
			nvp->UpdateViewportCoordinates(this);
 

	
 
			if (ni->reftype1 != NR_VEHICLE) {
 
				ScrollWindowToTile(GetReferenceTile(ni->reftype1, ni->ref1), this, true); // Re-center viewport.
 
			}
 
		}
 
	}
 

	
 
	/**
 
	 * Some data on this window has become invalid.
 
	 * @param data Information about the changed data.
0 comments (0 inline, 0 general)