summaryrefslogtreecommitdiff
path: root/frontends/windows
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 /frontends/windows
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 'frontends/windows')
-rw-r--r--frontends/windows/drawable.c14
1 files changed, 7 insertions, 7 deletions
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;
}