From ee3672efdbb4d3ebd3e0bd9e2d63273ad1273e64 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 9 May 2008 14:05:04 +0200 Subject: [PATCH] [cairo-pattern] Extend infinite pattern extents to negative coordinates too With things like meta-surface, the assumption that coordinates are always non-negative make no sense. Extend the "infinite" extents accordingly. Also remove stale comment. extents->width/height are unsigned these days and cover the full range. --- src/cairo-pattern.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c index 0f2eb3e70..aa32b85e7 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -2066,15 +2066,10 @@ _cairo_pattern_get_extents (cairo_pattern_t *pattern, * horizontal/vertical linear gradients). */ - /* XXX: because extents are represented as x, y, w, h we can't - * actually have a rectangle that covers our entire valid - * coordinate space, since we'd need width/height to be 2*INT_MAX. - */ - - extents->x = 0; - extents->y = 0; - extents->width = CAIRO_RECT_INT_MAX; - extents->height = CAIRO_RECT_INT_MAX; + extents->x = CAIRO_RECT_INT_MIN; + extents->y = CAIRO_RECT_INT_MIN; + extents->width = CAIRO_RECT_INT_MIN + CAIRO_RECT_INT_MAX; + extents->height = CAIRO_RECT_INT_MIN + CAIRO_RECT_INT_MAX; return CAIRO_STATUS_SUCCESS; }