1 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
2 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
3 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
4 @@ -2573,29 +2573,43 @@ static cairo_int_status_t
6 if (style->dash && style->num_dashes) {
8 cairo_quartz_float_t sdash[STATIC_DASH];
9 cairo_quartz_float_t *fdash = sdash;
10 unsigned int max_dashes = style->num_dashes;
13 - if (style->num_dashes%2)
15 - if (max_dashes > STATIC_DASH)
16 - fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t));
18 - return _cairo_error (CAIRO_STATUS_NO_MEMORY);
20 - for (k = 0; k < max_dashes; k++)
21 - fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes];
23 - CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes);
26 + bool set_line_dash = false;
27 + if (style->num_dashes % 2 == 0) {
28 + for (k = 1; k < max_dashes; k++) {
29 + if (style->dash[k]) {
30 + set_line_dash = true;
35 + set_line_dash = true;
37 + if (set_line_dash) {
38 + if (style->num_dashes%2)
40 + if (max_dashes > STATIC_DASH)
41 + fdash = _cairo_malloc_ab (max_dashes, sizeof (cairo_quartz_float_t));
43 + return _cairo_error (CAIRO_STATUS_NO_MEMORY);
45 + for (k = 0; k < max_dashes; k++)
46 + fdash[k] = (cairo_quartz_float_t) style->dash[k % style->num_dashes];
48 + CGContextSetLineDash (surface->cgContext, style->dash_offset, fdash, max_dashes);
52 + CGContextSetLineDash (state.context, 0, NULL, 0);
54 CGContextSetLineDash (state.context, 0, NULL, 0);
57 _cairo_quartz_cairo_path_to_quartz_context (path, state.context);
59 _cairo_quartz_cairo_matrix_to_quartz (ctm, &strokeTransform);
60 CGContextConcatCTM (state.context, strokeTransform);