From 72ac82e896f3602552d522430d6b9c3265ec5d8f Mon Sep 17 00:00:00 2001 From: ROllerozxa Date: Sun, 23 Jun 2024 23:33:23 +0200 Subject: [PATCH] Fix adventure item icons not adapting to window resize --- src/src/adventure.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/src/adventure.cc b/src/src/adventure.cc index 13c06bc3..330bfab4 100644 --- a/src/src/adventure.cc +++ b/src/src/adventure.cc @@ -1490,10 +1490,10 @@ adventure::render() margin_x = _tms.xppcm / 15.f; margin_y = _tms.yppcm / 15.f; static float base_x = margin_x + (.5f * _tms.xppcm)/2.f;// + (icon_width / 2.f); - static float base_y = _tms.window_height - G->wm->get_margin_y() - (1.0f * _tms.yppcm)/2.f; + float base_y = _tms.window_height - G->wm->get_margin_y() - (1.0f * _tms.yppcm)/2.f; /* calculate how much space we have to work with */ - static int num_icons_per_column = floorf(((_tms.window_width/2.f) - ((_tms.xppcm*2.f)/2.f) - margin_x - icon_width/2.f) / (icon_width + margin_x)); + int num_icons_per_column = floorf(((_tms.window_width/2.f) - ((_tms.xppcm*2.f)/2.f) - margin_x - icon_width/2.f) / (icon_width + margin_x)); int col = 0; int row = 0;