mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 07:00:08 +01:00
test: Fix clip-device-offset
The test was incorrectly translating the "target" of the context instead of the "group target" (i.e. the current destination). "cairo-test-suite -a" runs the tests on similar surfaces created using cairo_push_group (), thus without this change the device-offset did not affect the real destination surface. Fixes clip-device-offset.
This commit is contained in:
parent
7ad3aebbe6
commit
34612c400d
1 changed files with 3 additions and 3 deletions
|
|
@ -54,8 +54,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_pattern_t *source;
|
||||
double old_x, old_y;
|
||||
|
||||
cairo_surface_get_device_offset (cairo_get_target (cr), &old_x, &old_y);
|
||||
cairo_surface_set_device_offset (cairo_get_target (cr), old_x+5, old_y+5);
|
||||
cairo_surface_get_device_offset (cairo_get_group_target (cr), &old_x, &old_y);
|
||||
cairo_surface_set_device_offset (cairo_get_group_target (cr), old_x+5, old_y+5);
|
||||
|
||||
source = create_green_source ();
|
||||
cairo_set_source (cr, source);
|
||||
|
|
@ -66,7 +66,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_clip (cr);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_surface_set_device_offset (cairo_get_target (cr), old_x, old_y);
|
||||
cairo_surface_set_device_offset (cairo_get_group_target (cr), old_x, old_y);
|
||||
|
||||
return CAIRO_TEST_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue