diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-08-04 14:23:48 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-08-04 14:24:33 +0100 |
commit | 3be2b98cc2d5c4e7c97a6caba86d1869893f25eb (patch) | |
tree | 8baac0160c7c965f29c677d1b11fb23d8f267519 /content | |
parent | c88a55999a93f80462b01d25388172c67df0dc72 (diff) | |
download | netsurf-3be2b98cc2d5c4e7c97a6caba86d1869893f25eb.tar.gz netsurf-3be2b98cc2d5c4e7c97a6caba86d1869893f25eb.tar.bz2 |
change browser_window_drop_file_at_point() to take unscaled coordinates
Diffstat (limited to 'content')
-rw-r--r-- | content/handlers/html/html.c | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c index 1bbb4c699..7280ff66a 100644 --- a/content/handlers/html/html.c +++ b/content/handlers/html/html.c @@ -1925,11 +1925,11 @@ html_get_contextual_content(struct content *c, int x, int y, } if (box->iframe) { - browser_window_get_features( - box->iframe, - (x - box_x) * browser_window_get_scale(box->iframe), - (y - box_y) * browser_window_get_scale(box->iframe), - data); + float scale = browser_window_get_scale(box->iframe); + browser_window_get_features(box->iframe, + (x - box_x) * scale, + (y - box_y) * scale, + data); } if (box->object) @@ -2004,13 +2004,15 @@ html_scroll_at_point(struct content *c, int x, int y, int scrx, int scry) continue; /* Pass into iframe */ - if (box->iframe && - browser_window_scroll_at_point( - box->iframe, - (x - box_x) * browser_window_get_scale(box->iframe), - (y - box_y) * browser_window_get_scale(box->iframe), - scrx, scry) == true) - return true; + if (box->iframe) { + float scale = browser_window_get_scale(box->iframe); + + if (browser_window_scroll_at_point(box->iframe, + (x - box_x) * scale, + (y - box_y) * scale, + scrx, scry) == true) + return true; + } /* Pass into textarea widget */ if (box->gadget && (box->gadget->type == GADGET_TEXTAREA || @@ -2146,15 +2148,21 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file) &box_x, &box_y)) != NULL) { box = next; - if (box->style && css_computed_visibility(box->style) == - CSS_VISIBILITY_HIDDEN) + if (box->style && + css_computed_visibility(box->style) == CSS_VISIBILITY_HIDDEN) continue; - if (box->iframe) - return browser_window_drop_file_at_point(box->iframe, - x - box_x, y - box_y, file); + if (box->iframe) { + float scale = browser_window_get_scale(box->iframe); + return browser_window_drop_file_at_point( + box->iframe, + (x - box_x) * scale, + (y - box_y) * scale, + file); + } - if (box->object && content_drop_file_at_point(box->object, + if (box->object && + content_drop_file_at_point(box->object, x - box_x, y - box_y, file) == true) return true; |