From 0a8ed41a1ad470bb62c908d0dc6272c1c541a1f2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 2 Aug 2019 22:07:59 +0100 Subject: change browser_window_mouse_click to use unscaled coordinates this means frontends no longer need to scale mouse click events thus simplifying their implementation. --- frontends/windows/drawable.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'frontends/windows') diff --git a/frontends/windows/drawable.c b/frontends/windows/drawable.c index e1fdbc84e..3cded7e0c 100644 --- a/frontends/windows/drawable.c +++ b/frontends/windows/drawable.c @@ -431,8 +431,8 @@ nsws_drawable_mouseup(struct gui_window *gw, browser_window_mouse_click(gw->bw, gw->mouse->state, - (x + gw->scrollx) / gw->scale, - (y + gw->scrolly) / gw->scale); + (x + gw->scrollx), + (y + gw->scrolly)); } else { browser_window_mouse_track(gw->bw, 0, @@ -476,8 +476,8 @@ nsws_drawable_mousedown(struct gui_window *gw, (y + gw->scrolly) / gw->scale); browser_window_mouse_click(gw->bw, gw->mouse->state, - (x + gw->scrollx) / gw->scale, - (y + gw->scrolly) / gw->scale); + (x + gw->scrollx), + (y + gw->scrolly)); return 0; } @@ -497,8 +497,8 @@ nsws_drawable_mousemove(struct gui_window *gw, int x, int y) return 0; /* scale co-ordinates */ - x = (x + gw->scrollx) / gw->scale; - y = (y + gw->scrolly) / gw->scale; + x = (x + gw->scrollx) ; + y = (y + gw->scrolly); /* if mouse button held down and pointer moved more than * minimum distance drag is happening */ @@ -535,7 +535,7 @@ nsws_drawable_mousemove(struct gui_window *gw, int x, int y) gw->mouse->state &= ~BROWSER_MOUSE_MOD_3; - browser_window_mouse_track(gw->bw, gw->mouse->state, x, y); + browser_window_mouse_track(gw->bw, gw->mouse->state, x/ gw->scale, y/ gw->scale); return 0; } -- cgit v1.2.3