From f368c3c84923fd1d99fbbcf6a38ad10ed09a8098 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 15 Jun 2011 11:46:07 +0000 Subject: Improve scale with iframes. svn path=/trunk/netsurf/; revision=12477 --- desktop/browser.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 049289852..96d5a58d5 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -192,8 +192,8 @@ void browser_window_get_position(struct browser_window *bw, bool root, /* offset comes from its box position in parent bw */ box_coords(bw->box, &x, &y); - *pos_x += x; - *pos_y += y; + *pos_x += x * bw->scale; + *pos_y += y * bw->scale; break; } @@ -760,7 +760,7 @@ void browser_window_get_dimensions(struct browser_window *bw, case BROWSER_WINDOW_IFRAME: /* browser window is size of associated box */ box_bounds(bw->box, &rect); - /* TODO: Handle scale */ +LOG(("SCALED: %s", scaled ? "yes" : "no")); *width = rect.x1 - rect.x0; *height = rect.y1 - rect.y0; break; @@ -1334,7 +1334,13 @@ void browser_window_reformat(struct browser_window *bw, int width, int height) if (c == NULL) return; - content_reformat(c, width / bw->scale, height / bw->scale); + if (bw->browser_window_type != BROWSER_WINDOW_IFRAME) { + /* Iframe dimensions are already scaled in parent's layout */ + width /= bw->scale; + height /= bw->scale; + } + + content_reformat(c, width, height); } -- cgit v1.2.3