Pass struct rect to gui_window_update_box(), rather than union content_msg_data.

svn path=/trunk/netsurf/; revision=12574
This commit is contained in:
Michael Drake 2011-07-06 12:39:26 +00:00
parent 865af5f235
commit 727aa61bb6
2 changed files with 13 additions and 10 deletions

View File

@ -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;
}
}

View File

@ -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,