From fb3a193959bbfa71308338182f208e3221ddfa04 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 9 Feb 2012 22:06:18 +0000 Subject: [PATCH] clip: Check whether an extents only clip contains the box If we steal the boxes, we leave behind an extents-only clip, i.e. only without a path or boxes, in which case do not return FALSE for the is-contained check on a rectangle. Signed-off-by: Chris Wilson --- src/cairo-clip-boxes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c index be4497cec..7372c7334 100644 --- a/src/cairo-clip-boxes.c +++ b/src/cairo-clip-boxes.c @@ -85,6 +85,9 @@ _cairo_clip_contains_rectangle_box (const cairo_clip_t *clip, if (! _cairo_rectangle_contains_rectangle (&clip->extents, rect)) return FALSE; + if (clip->num_boxes == 0) + return TRUE; + /* Check for a clip-box that wholly contains the rectangle */ for (i = 0; i < clip->num_boxes; i++) { if (box->p1.x >= clip->boxes[i].p1.x &&