diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c index 519434c..a54ca85 100644 --- a/src/cairo-path-stroke.c +++ b/src/cairo-path-stroke.c @@ -63,6 +63,7 @@ typedef struct cairo_stroker { unsigned int dash_index; int dash_on; double dash_remain; + cairo_bool_t dash_connect_first_face; } cairo_stroker_t; /* private functions */ @@ -132,6 +133,7 @@ _cairo_stroker_start_dash (cairo_stroker stroker->dash_index = i; stroker->dash_on = on; stroker->dash_remain = stroker->style->dash[i] - offset; + stroker->dash_connect_first_face = (on == 1); } static void @@ -727,7 +729,7 @@ _cairo_stroker_line_to_dashed (void *clo if (status) return status; } else { - if (!stroker->has_first_face) { + if (!stroker->has_first_face && stroker->dash_connect_first_face) { stroker->first_face = sub_start; stroker->has_first_face = TRUE; } else { @@ -940,6 +942,8 @@ _cairo_stroker_close_path (void *closure stroker->has_sub_path = FALSE; stroker->has_first_face = FALSE; stroker->has_current_face = FALSE; + if (stroker->dashed) + stroker->dash_connect_first_face = (stroker->dash_on == 1); return CAIRO_STATUS_SUCCESS; }