diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2007-10-09 17:24:02 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2007-10-09 17:24:02 +0000 |
commit | e0ac355853c517208f87e2c713a19acaeccc1f6f (patch) | |
tree | 672d2e77c6ca1cabb237e8d7e8d00779d72903d5 /render/html_redraw.c | |
parent | 8df0a5ad4088f500d45178ac7f261e44507b9f6b (diff) | |
download | netsurf-e0ac355853c517208f87e2c713a19acaeccc1f6f.tar.gz netsurf-e0ac355853c517208f87e2c713a19acaeccc1f6f.tar.bz2 |
Correctly terminate the plot group of a clipped box. Clip visible children of hidden elements (fix 1808893).
svn path=/trunk/netsurf/; revision=3627
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r-- | render/html_redraw.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c index 70d33f704..3f72547e2 100644 --- a/render/html_redraw.c +++ b/render/html_redraw.c @@ -160,6 +160,7 @@ bool html_redraw_box(struct box *box, int x0, y0, x1, y1; int x_scrolled, y_scrolled; struct box *bg_box = NULL; + bool visible = true; /* avoid trivial FP maths */ if (scale == 1.0) { @@ -206,18 +207,14 @@ bool html_redraw_box(struct box *box, if (box->style && box->style->visibility == CSS_VISIBILITY_HIDDEN) { if ((plot.group_start) && (!plot.group_start("hidden box"))) return false; - if (!html_redraw_box_children(box, x_parent, y_parent, - x0, y0, x1, y1, scale, - current_background_color)) + visible = false; + } else { + if ((plot.group_start) && (!plot.group_start("vis box"))) return false; - return ((!plot.group_end) || (plot.group_end())); } - - if ((plot.group_start) && (!plot.group_start("vis box"))) - return false; - + /* dotted debug outlines */ - if (html_redraw_debug) { + if (html_redraw_debug && visible) { if (!plot.rectangle(x, y, padding_width, padding_height, 1, 0x0000ff, true, false)) return false; @@ -239,7 +236,7 @@ bool html_redraw_box(struct box *box, } /* borders */ - if (box->style && box->type != BOX_TEXT && (box->border[TOP] || + if (visible && box->style && box->type != BOX_TEXT && (box->border[TOP] || box->border[RIGHT] || box->border[BOTTOM] || box->border[LEFT])) if (!html_redraw_borders(box, x_parent, y_parent, @@ -260,8 +257,8 @@ bool html_redraw_box(struct box *box, if (clip_y1 < y1) y1 = clip_y1; /* no point trying to draw 0-width/height boxes */ if (x0 == x1 || y0 == y1) - /* not an error, so return true */ - return true; + /* not an error */ + return ((!plot.group_end) || (plot.group_end())); /* clip to it */ if (!plot.clip(x0, y0, x1, y1)) return false; @@ -272,6 +269,17 @@ bool html_redraw_box(struct box *box, x1 = clip_x1; y1 = clip_y1; } + + /* hidden elements */ + if (!visible) { + if (!html_redraw_box_children(box, x_parent, y_parent, + x0, y0, x1, y1, scale, + current_background_color)) + return false; + return ((!plot.group_end) || (plot.group_end())); + } + + /* background colour and image */ |