From 563e71caedb306a45f84d77bed32f2d237adf73d Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 25 Aug 2019 17:23:38 -0400 Subject: [PATCH] ...and for sdl1. --- sdl1/pdckbd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdl1/pdckbd.c b/sdl1/pdckbd.c index 236c528c..9fb789b6 100644 --- a/sdl1/pdckbd.c +++ b/sdl1/pdckbd.c @@ -256,8 +256,8 @@ static int _process_mouse_event(void) { int i; - SP->mouse_status.x = event.motion.x / pdc_fwidth; - SP->mouse_status.y = event.motion.y / pdc_fheight; + SP->mouse_status.x = (event.motion.x - pdc_xoffset) / pdc_fwidth; + SP->mouse_status.y = (event.motion.y - pdc_yoffset) / pdc_fheight; if (!event.motion.state || (SP->mouse_status.x == old_mouse_status.x && @@ -326,8 +326,8 @@ static int _process_mouse_event(void) } } - SP->mouse_status.x = event.button.x / pdc_fwidth; - SP->mouse_status.y = event.button.y / pdc_fheight; + SP->mouse_status.x = (event.button.x - pdc_xoffset) / pdc_fwidth; + SP->mouse_status.y = (event.button.y - pdc_yoffset) / pdc_fheight; btn--;