summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-11-17 17:14:10 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-11-17 17:14:10 +0000
commit61241b731c4d92ed2dc77beb262645cea1593fdb (patch)
treeb93111e1636a68f56db88344251c390734458367
parentbb260da36e2408421c548f93cbfd28fc0052f50f (diff)
downloadnetsurf-61241b731c4d92ed2dc77beb262645cea1593fdb.tar.gz
netsurf-61241b731c4d92ed2dc77beb262645cea1593fdb.tar.bz2
We need to adjust for the frontend needing to know the offsets based on where the scrollbars were, rather than where they are now.
-rw-r--r--desktop/browser.c13
-rw-r--r--desktop/frames.c2
2 files changed, 9 insertions, 6 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 0ecb0ac77..b7584c194 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1963,16 +1963,19 @@ void browser_window_copy_box(struct browser_window *bw, struct rect *rect, int x
}
} else {
/* Core managed browser window */
+ int off_x = scrollbar_get_offset(bw->scroll_x) - bw->prev_scroll_x;
+ int off_y = scrollbar_get_offset(bw->scroll_y) - bw->prev_scroll_x;
+
browser_window_get_position(bw, true, &pos_x, &pos_y);
top = browser_window_get_root(bw);
- rect->x0 += pos_x / bw->scale;
- rect->y0 += pos_y / bw->scale;
- rect->x1 += pos_x / bw->scale;
- rect->y1 += pos_y / bw->scale;
+ rect->x0 += (pos_x + off_x) / bw->scale;
+ rect->y0 += (pos_y + off_y) / bw->scale;
+ rect->x1 += (pos_x + off_x) / bw->scale;
+ rect->y1 += (pos_y + off_y) / bw->scale;
- if(gui_window_copy_box(top->window, rect, x + pos_x, y + pos_y) == false) {
+ if(gui_window_copy_box(top->window, rect, x + pos_x + off_x, y + pos_y + off_y) == false) {
gui_window_update_box(top->window, rect);
}
}
diff --git a/desktop/frames.c b/desktop/frames.c
index 88d49f20c..e0b90e8f7 100644
--- a/desktop/frames.c
+++ b/desktop/frames.c
@@ -70,7 +70,7 @@ void browser_window_scroll_callback(void *client_data,
int dest_y;
int cur_x = scrollbar_get_offset(bw->scroll_x);
int cur_y = scrollbar_get_offset(bw->scroll_y);
-
+
rect_y.x0 = 0;
rect_y.x1 = bw->width;
rect_x.y0 = 0;