diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-08-03 11:58:44 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-08-03 14:29:06 +0100 |
commit | d4c01894c21559cd4199c0f15b9e8b7bec4b692c (patch) | |
tree | 99a9dad1873b37a22ef344fd002484feefd93c70 /frontends | |
parent | 0ebfff259fa4ec6aaf5e97a213d5c65c24052e96 (diff) | |
download | netsurf-d4c01894c21559cd4199c0f15b9e8b7bec4b692c.tar.gz netsurf-d4c01894c21559cd4199c0f15b9e8b7bec4b692c.tar.bz2 |
change browser_window_get_features to use unscaled coordinates
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/amiga/gui.c | 3 | ||||
-rw-r--r-- | frontends/framebuffer/gui.c | 11 | ||||
-rw-r--r-- | frontends/gtk/scaffolding.c | 4 | ||||
-rw-r--r-- | frontends/gtk/window.c | 5 | ||||
-rw-r--r-- | frontends/riscos/window.c | 8 |
5 files changed, 14 insertions, 17 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 916851846..adce7dd0b 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -1919,8 +1919,7 @@ static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys) if(ami_mouse_to_ns_coords(gwin, &x, &y, -1, -1) == true) { - if(browser_window_scroll_at_point(gwin->gw->bw, x, y, - xs, ys) == false) + if(browser_window_scroll_at_point(gwin->gw->bw, x, y, xs, ys) == false) { int width, height; diff --git a/frontends/framebuffer/gui.c b/frontends/framebuffer/gui.c index 588f05b98..2ea893efb 100644 --- a/frontends/framebuffer/gui.c +++ b/frontends/framebuffer/gui.c @@ -627,7 +627,6 @@ fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi) struct gui_window *gw = cbi->context; struct browser_widget_s *bwidget = fbtk_get_userpw(widget); browser_mouse_state mouse; - float scale = browser_window_get_scale(gw->bw); int x = cbi->x + bwidget->scrollx; int y = cbi->y + bwidget->scrolly; uint64_t time_now; @@ -665,15 +664,17 @@ fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi) case NSFB_KEY_MOUSE_4: /* scroll up */ - if (browser_window_scroll_at_point(gw->bw, x/scale, y/scale, - 0, -100) == false) + if (browser_window_scroll_at_point(gw->bw, + x, y, + 0, -100) == false) widget_scroll_y(gw, -100, false); break; case NSFB_KEY_MOUSE_5: /* scroll down */ - if (browser_window_scroll_at_point(gw->bw, x/scale, y/scale, - 0, 100) == false) + if (browser_window_scroll_at_point(gw->bw, + x, y, + 0, 100) == false) widget_scroll_y(gw, 100, false); break; diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c index 6b6f936ff..8625d9a4c 100644 --- a/frontends/gtk/scaffolding.c +++ b/frontends/gtk/scaffolding.c @@ -2716,13 +2716,11 @@ void nsgtk_scaffolding_context_menu(struct nsgtk_scaffolding *g, { GtkMenu *gtkmenu; struct browser_window *bw; - float scale; bw = nsgtk_get_browser_window(g->top_level); - scale = browser_window_get_scale(bw); /* update the global context menu features */ - browser_window_get_features(bw, x/scale, y/scale, ¤t_menu_features); + browser_window_get_features(bw, x, y, ¤t_menu_features); if (current_menu_features.link != NULL) { /* menu is opening over a link */ diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c index ece586a85..5e8538f26 100644 --- a/frontends/gtk/window.c +++ b/frontends/gtk/window.c @@ -467,9 +467,8 @@ nsgtk_window_scroll_event(GtkWidget *widget, deltay *= nsgtk_adjustment_get_step_increment(vscroll); if (browser_window_scroll_at_point(g->bw, - event->x / browser_window_get_scale(g->bw), - event->y / browser_window_get_scale(g->bw), - deltax, deltay) != true) { + event->x, event->y, + deltax, deltay) != true) { /* core did not handle event so change adjustments */ diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c index 84029ef87..c4d32bd28 100644 --- a/frontends/riscos/window.c +++ b/frontends/riscos/window.c @@ -1154,8 +1154,8 @@ ro_gui_window_scroll_action(struct gui_window *g, if (pointer.w == g->window && ro_gui_window_to_window_pos(g, pointer.pos.x, pointer.pos.y, &pos)) handled = browser_window_scroll_at_point(g->bw, - pos.x/g->scale, - pos.y/g->scale, + pos.x, + pos.y, step_x, step_y); @@ -1251,7 +1251,7 @@ ro_gui_window_handle_local_keypress(struct gui_window *g, if (!ro_gui_window_to_window_pos(g, pointer.pos.x, pointer.pos.y, &pos)) return false; - browser_window_get_features(g->bw, pos.x/g->scale, pos.y/g->scale, &cont); + browser_window_get_features(g->bw, pos.x, pos.y, &cont); switch (c) { case IS_WIMP_KEY + wimp_KEY_F1: /* Help. */ @@ -2171,7 +2171,7 @@ ro_gui_window_menu_prepare(wimp_w w, if (ro_gui_window_to_window_pos(g, pointer->pos.x, pointer->pos.y, &pos)) { - browser_window_get_features(bw, pos.x/g->scale, pos.y/g->scale, &cont); + browser_window_get_features(bw, pos.x, pos.y, &cont); current_menu_main = cont.main; current_menu_object = cont.object; |