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. --- content/handlers/html/html_interaction.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'content') diff --git a/content/handlers/html/html_interaction.c b/content/handlers/html/html_interaction.c index 985b325e2..b6b9de89a 100644 --- a/content/handlers/html/html_interaction.c +++ b/content/handlers/html/html_interaction.c @@ -843,14 +843,14 @@ void html_mouse_action(struct content *c, struct browser_window *bw, browser_window_get_position(iframe, false, &pos_x, &pos_y); - pos_x /= scale; - pos_y /= scale; - if (mouse & BROWSER_MOUSE_CLICK_1 || - mouse & BROWSER_MOUSE_CLICK_2) { + mouse & BROWSER_MOUSE_CLICK_2) { browser_window_mouse_click(iframe, mouse, - x - pos_x, y - pos_y); + (x * scale) - pos_x, + (y * scale) - pos_y); } else { + pos_x /= scale; + pos_y /= scale; browser_window_mouse_track(iframe, mouse, x - pos_x, y - pos_y); } -- cgit v1.2.3