mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Fix: Update news window viewport if GUI zoom is changed.
This commit is contained in:
parent
57fa8690df
commit
8b989d4999
@ -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.
|
* Some data on this window has become invalid.
|
||||||
* @param data Information about the changed data.
|
* @param data Information about the changed data.
|
||||||
|
Loading…
Reference in New Issue
Block a user