From f9cc7a3b4662a5a8b4eff848aaec33d4c1786af0 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 31 May 2019 18:50:02 +0300 Subject: [PATCH] Fix SDL mouse support in SGB mode --- SDL/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDL/gui.c b/SDL/gui.c index bad36f2..39d7357 100644 --- a/SDL/gui.c +++ b/SDL/gui.c @@ -828,8 +828,8 @@ void run_gui(bool is_running) event.key.keysym.scancode = SDL_SCANCODE_ESCAPE; } else if (gui_state == SHOWING_MENU) { - signed x = (event.button.x - rect.x / factor) * 160 / (rect.w / factor) - x_offset; - signed y = (event.button.y - rect.y / factor) * 144 / (rect.h / factor) - y_offset; + signed x = (event.button.x - rect.x / factor) * width / (rect.w / factor) - x_offset; + signed y = (event.button.y - rect.y / factor) * height / (rect.h / factor) - y_offset; if (strcmp("CRT", configuration.filter) == 0) { y = y * 8 / 7;