Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed.

(cherry picked from commit 4791ff2862)
This commit is contained in:
Peter Nelson
2021-04-05 18:43:12 +01:00
committed by Jonathan G Rennison
parent 43a3a233df
commit a469b4f395
14 changed files with 130 additions and 29 deletions

View File

@@ -3486,7 +3486,7 @@ void HideVitalWindows()
}
/** Re-initialize all windows. */
void ReInitAllWindows()
void ReInitAllWindows(bool zoom_changed)
{
NWidgetLeaf::InvalidateDimensionCache(); // Reset cached sizes of several widgets.
NWidgetScrollbar::InvalidateDimensionCache();
@@ -3495,6 +3495,7 @@ void ReInitAllWindows()
InitDepotWindowBlockSizes();
for (Window *w : Window::IterateFromBack()) {
if (zoom_changed) w->nested_root->AdjustPaddingForZoom();
w->ReInit();
}