mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
Add cairo_path_extents testing to several cases missing it
With these degenerate shapes, cairo_path_extents still returns a zero-area rectangle, but with a non-zero offset.
This commit is contained in:
parent
63df3a82a3
commit
55e0dddf04
1 changed files with 8 additions and 4 deletions
|
|
@ -134,7 +134,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_rel_line_to (cr2, 0., 0.);
|
||||
phase = "Degenerate line";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, PATH, EQUALS, 200, 400, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
|
|
@ -142,21 +143,24 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_rel_curve_to (cr2, 0., 0., 0., 0., 0., 0.);
|
||||
phase = "Degenerate curve";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, PATH, EQUALS, 200, 400, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_arc (cr2, 200, 400, 0., 0, 2 * M_PI);
|
||||
phase = "Degenerate arc (R=0)";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, PATH, EQUALS, 200, 400, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
cairo_arc (cr2, 200, 400, 10., 0, 0);
|
||||
phase = "Degenerate arc (Θ=0)";
|
||||
if (!check_extents (phase, cr2, FILL, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0))
|
||||
!check_extents (phase, cr2, STROKE, EQUALS, 0, 0, 0, 0) ||
|
||||
!check_extents (phase, cr2, PATH, EQUALS, 200, 400, 0, 0))
|
||||
ret = CAIRO_TEST_FAILURE;
|
||||
|
||||
cairo_new_path (cr2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue