From 9bd5b4a91b87fe4e859bd8439dc2408382380078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B3=87=20=CF=BA=E2=9A=B8=D0=AF=E2=84=87=E2=9A=94=20?= =?UTF-8?q?=E1=B3=87?= Date: Wed, 11 Nov 2020 12:57:00 +0100 Subject: [PATCH] Fixed forcing full map update on city map --- client/gui-qt/citydlg.cpp | 10 +++++++--- client/mapview_common.cpp | 15 ++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp index 896f3ea0b8..d88d799c47 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -2893,8 +2893,7 @@ void qtg_real_city_dialog_popup(struct city *pcity) city_dialog::instance()->show(); city_dialog::instance()->activateWindow(); city_dialog::instance()->raise(); - dirty_all(); - flush_dirty(); + map_canvas_resized(mapview.width, mapview.height); } /************************************************************************/ /** @@ -2913,12 +2912,17 @@ void destroy_city_dialog() void qtg_popdown_city_dialog(struct city *pcity) { city_dialog::instance()->hide(); + map_canvas_resized(mapview.width, mapview.height); } /************************************************************************/ /** Close the dialogs for all cities. ****************************************************************************/ -void qtg_popdown_all_city_dialogs() { destroy_city_dialog(); } +void qtg_popdown_all_city_dialogs() +{ + destroy_city_dialog(); + map_canvas_resized(mapview.width, mapview.height); +} /************************************************************************/ /** Refresh (update) all data for the given city's dialog. diff --git a/client/mapview_common.cpp b/client/mapview_common.cpp index cb674f2855..495a05d2d9 100644 --- a/client/mapview_common.cpp +++ b/client/mapview_common.cpp @@ -1319,7 +1319,7 @@ void put_drawn_sprites(struct canvas *pcanvas, float zoom, int canvas_x, } } } -#include + /************************************************************************/ /** Draw one layer of a tile, edge, corner, unit, and/or city onto the canvas at the given position. @@ -1341,10 +1341,9 @@ void put_one_element(struct canvas *pcanvas, float zoom, if (ptile) { struct city *xcity = is_any_city_dialog_open(); if (xcity) { + // Attack of dummies ! int dummy_x, dummy_y; - //struct city *xcity = find_city_near_tile(ptile); - if (xcity - && !city_base_to_city_map(&dummy_x, &dummy_y, xcity, ptile)) { + if (!city_base_to_city_map(&dummy_x, &dummy_y, xcity, ptile)) { city_mode = true; } } @@ -3620,11 +3619,9 @@ bool map_canvas_resized(int width, int height) mapview.store_width = full_width; mapview.store_height = full_height; - /* Check for what's changed. */ - tile_size_changed = - (tile_width != old_tile_width || tile_height != old_tile_height); - size_changed = (width != old_width || height != old_height); - + /* use that function to clear cache */ + tile_size_changed = true; + size_changed = true; /* If the tile size has changed, resize the canvas. */ if (tile_size_changed) { if (mapview.store) {