Inkscape does not correctly render square linecaps of zero-length paths

Bug #1690959 reported by Patrick Storz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

When defining a zero length path like

<path d="m0 0 0 0" stroke="black" stroke-linecap="square" />

Inkscape fails to render the linecap (it should result in a small square with 1x1 px²).

The same issue existed for round linecaps but was fixed at some point, see bug #166298.
Related (but also only talking about round linecaps): bug #689562.

Find attached a testcase showing the three types of linecaps applied to zero-width strokes:
- butt
- round
- square

While butt should result in no visual output, square and round should result in a visible dot or square respectively [1].

Sample renderings will also be attached for
- Inkscape (fails to render square)
- Firefox (renders the testcase correctly)
- librsvg (fails to render square, too)

[1] https://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes

Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :

Seems this is a cairo limitation. As PS/PDF do not render square linecaps on zero-length paths (as the direction would be undefined) cairo followed this behavior, see [1].

This obviously makes it hard for applications using cairo to render SVGs to conform with the SVG spec. For example Firefox had the same issue and worked around it by manipulating zero-length paths to have a really short length, see [2,3].

Just for reference: Find the relveant test from the SVG 1.1 testsuite at [4].

[1] https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-stroke
[2] https://api-dev.bugzilla.mozilla.org/show_bug.cgi?id=589648
[3] https://api-dev.bugzilla.mozilla.org/show_bug.cgi?id=1187770
[4] https://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObjectMiniApproved/painting-control-04-f.html

summary: - Inkscape does not correctly render linecaps of zero-length paths
+ Inkscape does not correctly render square linecaps of zero-length paths
Revision history for this message
Nathan Lee (nathan.lee) wrote :

Closing as part of great bug migration

Issue now at: https://gitlab.com/inkscape/inkscape/issues/894

Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.