Skip to content

Commit

Permalink
Don't scale map window in F6 mode
Browse files Browse the repository at this point in the history
fill the screen, with the GUI buttons drawn directly on top. The tab map window was also scaled, but as a result,
parts of the map and accompanying text shift under the buttons. Fix by not resizing the map window.
  • Loading branch information
gvissers committed Jul 13, 2021
1 parent 7fe7b15 commit c256cc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions interface.c
Expand Up @@ -642,10 +642,11 @@ int switch_to_game_map(void)

map_font_scale_fac = get_global_scale();
// Set screen coordinates of the edges of the map
size = min2i(4*(window_width-hud_x)/5, window_height-hud_y);
small_map_screen_x_left = (window_width - hud_x - 5*size/4) / 2;
// Don't use hud_[xy] here, otherwise the tab map will shift under the GUI buttons in F6 mode.
size = min2i(4*(window_width-HUD_MARGIN_X)/5, window_height-HUD_MARGIN_Y);
small_map_screen_x_left = (window_width - HUD_MARGIN_X - 5*size/4) / 2;
small_map_screen_x_right = small_map_screen_x_left + size/4;
small_map_screen_y_top = (window_height - hud_y - size) / 2;
small_map_screen_y_top = (window_height - HUD_MARGIN_Y - size) / 2;
small_map_screen_y_bottom = small_map_screen_y_top + size/4;
main_map_screen_x_left = small_map_screen_x_right;
main_map_screen_x_right = main_map_screen_x_left + size;
Expand Down

0 comments on commit c256cc8

Please sign in to comment.