[cairo-commit] src/cairo-pattern.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Sep 29 10:02:58 PDT 2008


 src/cairo-pattern.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 6da8d8ea62399d94281a2a262a630ef113062d0c
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 29 17:56:34 2008 +0100

    [pattern] Fix up OBO introduced to cloned area
    
    In the midst of porting 5eec3e378afd6ff9991cea8e42b8478eb3e79773 I failed
    to include the pad in the floor() and ceil() which introduces two
    potential off-by-one errors into each dimension of the region of interest
    of the source surface.

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 5bfeb5b..71dfda2 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1873,10 +1873,10 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t   *pattern,
 						       &x1, &y1, &x2, &y2,
 						       NULL);
 
-		sampled_area.x = floor (x1) - pad;
-		sampled_area.y = floor (y1) - pad;
-		sampled_area.width  = ceil (x2) + pad - sampled_area.x;
-		sampled_area.height = ceil (y2) + pad - sampled_area.y;
+		sampled_area.x = floor (x1 - pad);
+		sampled_area.y = floor (y1 - pad);
+		sampled_area.width  = ceil (x2 + pad) - sampled_area.x;
+		sampled_area.height = ceil (y2 + pad) - sampled_area.y;
 	    }
 
 	    sampled_area.x += tx;


More information about the cairo-commit mailing list