summaryrefslogtreecommitdiff
path: root/render/html_redraw.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-06-15 14:47:15 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-06-15 14:47:15 +0100
commit43f21bc9a808f90e2fe1bce851ca04faed412c4a (patch)
treed3fd72bb689a884e685592715e376f63f468694d /render/html_redraw.c
parent16dea2e2bd5a1e30725c88294f5844630dd724bc (diff)
downloadnetsurf-43f21bc9a808f90e2fe1bce851ca04faed412c4a.tar.gz
netsurf-43f21bc9a808f90e2fe1bce851ca04faed412c4a.tar.bz2
Slight simplification to how wo choose whether to clip for overflow.
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r--render/html_redraw.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c
index 46d38dafe..2ceb23934 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -2333,23 +2333,35 @@ bool html_redraw_box(const html_content *html, struct box *box,
* or scroll */
need_clip = false;
if (box->object || box->flags & IFRAME ||
- (box->style && (overflow_x != CSS_OVERFLOW_VISIBLE ||
- overflow_y != CSS_OVERFLOW_VISIBLE))) {
+ (overflow_x != CSS_OVERFLOW_VISIBLE &&
+ overflow_y != CSS_OVERFLOW_VISIBLE)) {
r.x0 = x;
+ r.y0 = y;
r.x1 = x + padding_width;
+ r.y1 = y + padding_height;
+ if (r.x0 < clip->x0) r.x0 = clip->x0;
+ if (r.y0 < clip->y0) r.y0 = clip->y0;
+ if (clip->x1 < r.x1) r.x1 = clip->x1;
+ if (clip->y1 < r.y1) r.y1 = clip->y1;
+ if (r.x1 <= r.x0 || r.y1 <= r.y0)
+ return ((!plot->group_end) || (plot->group_end()));
+ need_clip = true;
+
+ } else if (overflow_x != CSS_OVERFLOW_VISIBLE) {
+ r.x0 = x;
+ r.y0 = clip->y0;
+ r.x1 = x + padding_width;
+ r.y1 = clip->y1;
if (r.x0 < clip->x0) r.x0 = clip->x0;
if (clip->x1 < r.x1) r.x1 = clip->x1;
if (r.x1 <= r.x0)
return ((!plot->group_end) || (plot->group_end()));
need_clip = true;
- }
- /* clip to the padding edge for objects, or boxes with overflow hidden
- * or scroll */
- if (box->object || box->flags & IFRAME ||
- (box->style && (overflow_x != CSS_OVERFLOW_VISIBLE ||
- overflow_y != CSS_OVERFLOW_VISIBLE))) {
+ } else if (overflow_y != CSS_OVERFLOW_VISIBLE) {
+ r.x0 = clip->x0;
r.y0 = y;
+ r.x1 = clip->x1;
r.y1 = y + padding_height;
if (r.y0 < clip->y0) r.y0 = clip->y0;
if (clip->y1 < r.y1) r.y1 = clip->y1;