From 727aa61bb6f283cb81c53629932030a276483140 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 6 Jul 2011 12:39:26 +0000 Subject: Pass struct rect to gui_window_update_box(), rather than union content_msg_data. svn path=/trunk/netsurf/; revision=12574 --- desktop/browser.c | 21 ++++++++++++--------- desktop/gui.h | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/desktop/browser.c b/desktop/browser.c index 0fc2f1e72..c84104312 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1184,15 +1184,20 @@ void browser_window_update_box(struct browser_window *bw, { int pos_x; int pos_y; - union content_msg_data data_copy = *data; + struct rect rect; struct browser_window *top; + rect.x0 = data->redraw.x; + rect.y0 = data->redraw.y; + rect.x1 = data->redraw.x + data->redraw.width; + rect.y1 = data->redraw.y + data->redraw.height; + switch (bw->browser_window_type) { default: /* fall through for frame(set)s, * until they are handled by core */ case BROWSER_WINDOW_NORMAL: - gui_window_update_box(bw->window, data); + gui_window_update_box(bw->window, &rect); break; case BROWSER_WINDOW_IFRAME: @@ -1200,14 +1205,12 @@ void browser_window_update_box(struct browser_window *bw, top = browser_window_get_root(bw); - /* TODO: update gui_window_update_box so it takes a struct rect - * instead of msg data. */ - data_copy.redraw.x += pos_x / bw->scale; - data_copy.redraw.y += pos_y / bw->scale; - data_copy.redraw.object_x += pos_x / bw->scale; - data_copy.redraw.object_y += pos_y / bw->scale; + rect.x0 += pos_x / bw->scale; + rect.y0 += pos_y / bw->scale; + rect.x1 += pos_x / bw->scale; + rect.y1 += pos_y / bw->scale; - gui_window_update_box(top->window, &data_copy); + gui_window_update_box(top->window, &rect); break; } } diff --git a/desktop/gui.h b/desktop/gui.h index a3c853633..331bce882 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -82,7 +82,7 @@ void gui_window_destroy(struct gui_window *g); void gui_window_set_title(struct gui_window *g, const char *title); void gui_window_redraw_window(struct gui_window *g); void gui_window_update_box(struct gui_window *g, - const union content_msg_data *data); + const struct rect *rect); bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy); void gui_window_set_scroll(struct gui_window *g, int sx, int sy); void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, -- cgit v1.2.3