From d7387f39955d8047f59003a7ad2864d59fb648bf Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 13 Oct 2020 21:33:59 +0100 Subject: [PATCH] Fix changing smallmap legend not updating viewport maps --- src/smallmap_gui.cpp | 4 +++- src/viewport_func.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 33b2523eb2..f46c38b786 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -487,8 +487,10 @@ static void NotifyAllViewports(ViewportMapType map_type) Window *w; FOR_ALL_WINDOWS_FROM_BACK(w) { if (w->viewport != nullptr) - if (w->viewport->zoom >= ZOOM_LVL_DRAW_MAP && w->viewport->map_type == map_type) + if (w->viewport->zoom >= ZOOM_LVL_DRAW_MAP && w->viewport->map_type == map_type) { + ClearViewportLandPixelCache(w->viewport); w->InvalidateData(); + } } } diff --git a/src/viewport_func.h b/src/viewport_func.h index 2ba709b835..229964b489 100644 --- a/src/viewport_func.h +++ b/src/viewport_func.h @@ -24,6 +24,7 @@ static const int TILE_HEIGHT_STEP = 50; ///< One Z unit tile height difference i void SetSelectionRed(bool); void ClearViewportCache(Viewport *vp); +void ClearViewportLandPixelCache(Viewport *vp); void ClearViewportCaches(); void DeleteWindowViewport(Window *w); void InitializeWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom);