summaryrefslogtreecommitdiff
path: root/test/get-group-target.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-06-07 13:51:58 -0700
committerCarl Worth <cworth@cworth.org>2006-06-07 14:00:15 -0700
commitb7b3d05d78f22b6b45c6a54f2647dbdaeb034d37 (patch)
tree289b08bd336c65806ce2f1f7ea5e62e35c3f859f /test/get-group-target.c
parent45ca22e5e1a177a4dc9854cd310e5c683df058cb (diff)
Fix bug in get-group-target (in the test itself) letting it now pass.
Diffstat (limited to 'test/get-group-target.c')
-rw-r--r--test/get-group-target.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/get-group-target.c b/test/get-group-target.c
index 5bc9307b..d0a51646 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. */