From e6898829fd9b235566b9e1cf6b3355f6f82dd287 Mon Sep 17 00:00:00 2001 From: cazfi Date: Thu, 3 Nov 2016 06:03:31 +0000 Subject: [PATCH] Use correct factor in all situations when scaling down sdl-client citymap. See bug #25251 git-svn-id: svn://svn.gna.org/svn/freeciv/branches/S2_6@34345 a0f10bec-cc02-0410-94fc-a9cfff90b4cd --- client/gui-sdl/citydlg.c | 8 +++----- client/gui-sdl2/citydlg.c | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/client/gui-sdl/citydlg.c b/client/gui-sdl/citydlg.c index a312c2c76a..e1b43519a9 100644 --- a/client/gui-sdl/citydlg.c +++ b/client/gui-sdl/citydlg.c @@ -63,8 +63,6 @@ #include "citydlg.h" /* ============================================================= */ -#define SCALLED_TILE_WIDTH 48 -#define SCALLED_TILE_HEIGHT 24 static struct city_dialog { struct city *pCity; @@ -1572,11 +1570,11 @@ static void disable_city_dlg_widgets(void) SDL_Surface *get_scaled_city_map(struct city *pCity) { SDL_Surface *pBuf = create_city_map(pCity); - - city_map_zoom = ((pBuf->w > pBuf->h) ? + + city_map_zoom = ((pBuf->w * 159 > pBuf->h * 249) ? (float)adj_size(249) / pBuf->w : (float)adj_size(159) / pBuf->h); - + return zoomSurface(pBuf, city_map_zoom, city_map_zoom, 1); } diff --git a/client/gui-sdl2/citydlg.c b/client/gui-sdl2/citydlg.c index a736285198..20ba3b9218 100644 --- a/client/gui-sdl2/citydlg.c +++ b/client/gui-sdl2/citydlg.c @@ -67,8 +67,6 @@ #include "citydlg.h" /* ============================================================= */ -#define SCALLED_TILE_WIDTH 48 -#define SCALLED_TILE_HEIGHT 24 static struct city_dialog { struct city *pCity; @@ -1571,7 +1569,7 @@ SDL_Surface *get_scaled_city_map(struct city *pCity) { SDL_Surface *pBuf = create_city_map(pCity); - city_map_zoom = ((pBuf->w > pBuf->h) ? + city_map_zoom = ((pBuf->w * 159 > pBuf->h * 249) ? (float)adj_size(249) / pBuf->w : (float)adj_size(159) / pBuf->h); -- 2.11.4.GIT