Skip to content

Commit

Permalink
Fix adventure item icons not adapting to window resize
Browse files Browse the repository at this point in the history
  • Loading branch information
rollerozxa committed Jun 23, 2024
1 parent f5f38ee commit 72ac82e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/src/adventure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 72ac82e

Please sign in to comment.