diff options
author | James Bursa <james@netsurf-browser.org> | 2006-06-25 23:07:24 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2006-06-25 23:07:24 +0000 |
commit | f1a1143a24e8d695a4f32d77d8b15b5e666328e6 (patch) | |
tree | b6d47f98c6b7f57cf1365c6ff8f5922991c51423 | |
parent | 1404431fef7a69fb90c545d3937012b584700fb1 (diff) | |
download | netsurf-f1a1143a24e8d695a4f32d77d8b15b5e666328e6.tar.gz netsurf-f1a1143a24e8d695a4f32d77d8b15b5e666328e6.tar.bz2 |
Fix rendering of float children of a hidden box. Render box absolute children.
svn path=/trunk/netsurf/; revision=2646
-rw-r--r-- | render/html_redraw.c | 87 |
1 files changed, 63 insertions, 24 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index 16d2dcb85..b7555ca63 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -32,6 +32,10 @@ static bool html_redraw_box(struct box *box, int x, int y, int clip_x0, int clip_y0, int clip_x1, int clip_y1, float scale, colour current_background_color); +static bool html_redraw_box_children(struct box *box, + int x_parent, int y_parent, + int clip_x0, int clip_y0, int clip_x1, int clip_y1, + float scale, colour current_background_color); static bool html_redraw_text_box(struct box *box, int x, int y, int x0, int y0, int x1, int y1, float scale, colour current_background_color); @@ -129,7 +133,6 @@ bool html_redraw_box(struct box *box, int clip_x0, int clip_y0, int clip_x1, int clip_y1, float scale, colour current_background_color) { - struct box *c; int x, y; int width, height; int padding_left, padding_top, padding_width, padding_height; @@ -181,13 +184,10 @@ bool html_redraw_box(struct box *box, if (box->style && box->style->visibility == CSS_VISIBILITY_HIDDEN) { if (!plot.group_start("hidden box")) return false; - for (c = box->children; c; c = c->next) - if (!html_redraw_box(c, - x_parent + box->x - box->scroll_x, - y_parent + box->y - box->scroll_y, - x0, y0, x1, y1, - scale, current_background_color)) - return false; + if (!html_redraw_box_children(box, x_parent, y_parent, + x0, y0, x1, y1, scale, + current_background_color)) + return false; return plot.group_end(); } @@ -317,22 +317,10 @@ bool html_redraw_box(struct box *box, return false; } else { - for (c = box->children; c != 0; c = c->next) - if (c->type != BOX_FLOAT_LEFT && c->type != BOX_FLOAT_RIGHT) - if (!html_redraw_box(c, - x_parent + box->x - box->scroll_x, - y_parent + box->y - box->scroll_y, - x0, y0, x1, y1, scale, - current_background_color)) - return false; - - for (c = box->float_children; c != 0; c = c->next_float) - if (!html_redraw_box(c, - x_parent + box->x - box->scroll_x, - y_parent + box->y - box->scroll_y, - x0, y0, x1, y1, scale, - current_background_color)) - return false; + if (!html_redraw_box_children(box, x_parent, y_parent, + x0, y0, x1, y1, scale, + current_background_color)) + return false; } /* scrollbars */ @@ -354,6 +342,57 @@ bool html_redraw_box(struct box *box, /** + * Draw the various children of a box. + * + * \param box box to draw + * \param x_parent coordinate of parent box + * \param y_parent coordinate of parent box + * \param clip_x0 clip rectangle + * \param clip_y0 clip rectangle + * \param clip_x1 clip rectangle + * \param clip_y1 clip rectangle + * \param scale scale for redraw + * \param current_background_color background colour under this box + * \return true if successful, false otherwise + */ + +bool html_redraw_box_children(struct box *box, + int x_parent, int y_parent, + int clip_x0, int clip_y0, int clip_x1, int clip_y1, + float scale, colour current_background_color) +{ + struct box *c; + + for (c = box->children; c; c = c->next) + if (c->type != BOX_FLOAT_LEFT && c->type != BOX_FLOAT_RIGHT) + if (!html_redraw_box(c, + x_parent + box->x - box->scroll_x, + y_parent + box->y - box->scroll_y, + clip_x0, clip_y0, clip_x1, clip_y1, + scale, current_background_color)) + return false; + + for (c = box->float_children; c; c = c->next_float) + if (!html_redraw_box(c, + x_parent + box->x - box->scroll_x, + y_parent + box->y - box->scroll_y, + clip_x0, clip_y0, clip_x1, clip_y1, + scale, current_background_color)) + return false; + + for (c = box->absolute_children; c; c = c->next) + if (!html_redraw_box(c, + x_parent + box->x - box->scroll_x, + y_parent + box->y - box->scroll_y, + clip_x0, clip_y0, clip_x1, clip_y1, + scale, current_background_color)) + return false; + + return true; +} + + +/** * Redraw the text content of a box, possibly partially highlighted * because the text has been selected, or matches a search operation. * |