summaryrefslogtreecommitdiff
path: root/src/cairo-path-stroke.c
diff options
context:
space:
mode:
authorJeff Muizelaar <jeff@infidigm.net>2006-04-09 23:11:11 -0400
committerJeff Muizelaar <jeff@freiheit.infidigm.net>2006-04-13 23:41:45 -0400
commit5eaf71e77bd975f5865cc059b4aa4d57c096688e (patch)
tree9cca34dee0f0d41826621bbbe5e5cfb03a006958 /src/cairo-path-stroke.c
parent20fca01a2cc539df017e442be0cc6ad35353571f (diff)
Move the test for zero length sub edges below the computation of faces.
Face computation still works if a line has zero length, all that is needed is a slope and a point. This patch fixes bug #5561 because the faces are initialized even if the segment has zero length as expected by _cairo_stroker_line_to_dashed.
Diffstat (limited to 'src/cairo-path-stroke.c')
-rw-r--r--src/cairo-path-stroke.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index 4fe7e311..870dc504 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -554,13 +554,6 @@ _cairo_stroker_add_sub_edge (cairo_stroker_t *stroker, cairo_point_t *p1, cairo_
cairo_status_t status;
cairo_polygon_t polygon;
- if (p1->x == p2->x && p1->y == p2->y) {
- /* XXX: Need to rethink how this case should be handled, (both
- here and in _compute_face). The key behavior is that
- degenerate paths should draw as much as possible. */
- return CAIRO_STATUS_SUCCESS;
- }
-
_compute_face (p1, slope, stroker, start);
/* XXX: This could be optimized slightly by not calling
@@ -568,6 +561,13 @@ _cairo_stroker_add_sub_edge (cairo_stroker_t *stroker, cairo_point_t *p1, cairo_
fields from start. */
_compute_face (p2, slope, stroker, end);
+ if (p1->x == p2->x && p1->y == p2->y) {
+ /* XXX: Need to rethink how this case should be handled, (both
+ here and in _compute_face). The key behavior is that
+ degenerate paths should draw as much as possible. */
+ return CAIRO_STATUS_SUCCESS;
+ }
+
/* XXX: I should really check the return value of the
move_to/line_to functions here to catch out of memory
conditions. But since that would be ugly, I'd prefer to add a