summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-08-02 22:07:59 +0100
committerVincent Sanders <vince@kyllikki.org>2019-08-03 14:29:05 +0100
commit0a8ed41a1ad470bb62c908d0dc6272c1c541a1f2 (patch)
tree149a44db1bbea14e8fb4577ad53b01cfc472e527 /content
parent182c4ddefe6c1cd050361febb344ccd8cd5d1c96 (diff)
downloadnetsurf-0a8ed41a1ad470bb62c908d0dc6272c1c541a1f2.tar.gz
netsurf-0a8ed41a1ad470bb62c908d0dc6272c1c541a1f2.tar.bz2
change browser_window_mouse_click to use unscaled coordinates
this means frontends no longer need to scale mouse click events thus simplifying their implementation.
Diffstat (limited to 'content')
-rw-r--r--content/handlers/html/html_interaction.c10
1 files changed, 5 insertions, 5 deletions
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);
}