[cairo-commit] test/get-group-target.c

Carl Worth cworth at kemper.freedesktop.org
Wed Jun 7 14:04:45 PDT 2006


 test/get-group-target.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

New commits:
diff-tree b7b3d05d78f22b6b45c6a54f2647dbdaeb034d37 (from 45ca22e5e1a177a4dc9854cd310e5c683df058cb)
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Jun 7 13:51:58 2006 -0700

    Fix bug in get-group-target (in the test itself) letting it now pass.

diff --git a/test/get-group-target.c b/test/get-group-target.c
index 5bc9307..d0a5164 100644
--- a/test/get-group-target.c
+++ b/test/get-group-target.c
@@ -60,10 +60,20 @@ draw (cairo_t *cr, int width, int height
     /* Then paint in green what we query the group surface size to be. */
     cairo_set_source_rgb (cr, 0.0, 1.0, 0.0);
     cairo_surface_get_device_offset (group, &x, &y);
+    /* Or rather, we calculate the group surface size based on the
+     * only thing we can query which is the device offset. Ideally,
+     * the size would always be the minimal (width - 2 * PAD, height -
+     * 2 * PAD) based on the clip. But currently, group targets are
+     * created oversized for paginated surfaces, so we only subtract
+     * anything from the size if there is a non-zero device offfset.
+     *
+     * The calculation below might also be less confusing if the sign
+     * convention on the device offset were reversed, but it is what
+     * it is. Oh well. */
     cairo_rectangle (cr,
 		     -x, -y,
-		     width - 2 * PAD,
-		     height - 2 * PAD);
+		     width + 2 * x,
+		     height + 2 * y);
     cairo_fill (cr);
 
     /* Finish up the group painting. */


More information about the cairo-commit mailing list