File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -626,7 +626,14 @@ void GraphicsContextRenderer::set_dashes(
626626 for (auto i = 0 ; i < n; ++i) {
627627 buf[i] = points_to_pixels (dashes_raw[i]);
628628 }
629- cairo_set_dash (cr_, buf.get (), n, points_to_pixels (*dash_offset));
629+ if (std::all_of (buf.get (), buf.get () + n, std::logical_not{})) {
630+ // Treat fully zero dash arrays as solid stroke. This is consistent with
631+ // the SVG spec (PDF and PS specs explicitly reject such arrays), and
632+ // also generated by Matplotlib for zero-width lines due to dash scaling.
633+ cairo_set_dash (cr_, nullptr , 0 , 0 );
634+ } else {
635+ cairo_set_dash (cr_, buf.get (), n, points_to_pixels (*dash_offset));
636+ }
630637 } else {
631638 cairo_set_dash (cr_, nullptr , 0 , 0 );
632639 }
You can’t perform that action at this time.
0 commit comments