Skip to content

Commit 1fae6d7

Browse files
committed
take into account the unlikely case of the game window being smaller than 320x200
1 parent 739094b commit 1fae6d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mouse.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,9 @@ void Mouse::set_speed_cursor() {
335335
// Create a speed rectangle that's half of the game window dimensions
336336
// but with a minimum size of 200x200
337337
const TileRect game_rect = gwin->get_game_rect();
338-
const int rect_size
339-
= std::max(200, std::min(game_rect.w, game_rect.h) / 2);
338+
const int rect_size = std::max(
339+
std::min(200, std::min(game_rect.w, game_rect.h)),
340+
std::min(game_rect.w, game_rect.h) / 2);
340341
const TileRect speed_rect(
341342
ax - rect_size / 2, ay - rect_size / 2, rect_size, rect_size);
342343
const bool in_speed_rect

0 commit comments

Comments
 (0)