zero-length subpaths with round linecaps are not rendered

Bug #166298 reported by sas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

According to the definition of the 'stroke' property in
the SVG spec

http://www.w3.org/TR/SVG11/painting.html#StrokeProperties

a stroked subpath consisting only of a moveto and a
lineto to the same point, or of a moveto and a
closepath, should be rendered (as a circle) if
stroke-linecap="round". This does not work in Inkscape
0.41.

The attached SVG file demonstrates this bug. Abode and
Batik correctly display this as two black circular
disks of radius equal to half the stroke width, but
Inkscape just shows a blank page. Exporting to PNG
gives a blank image too.

Tags: svg
Revision history for this message
sas (sas-sas) wrote :

Attempting to post attachment again.

Revision history for this message
Piersvdt (piersvdt) wrote :

With dashed strokes there is the problem when you use 0 in a
dasharray like stroke-dasharray:0, 100, i think when round
is selected there should be circles, and with square
squares, since squares aren't rendered on a zero lenght path
maybe not with squares, but a line has a direction, so why not?

Revision history for this message
Piersvdt (piersvdt) wrote :

Strange, the implementation notes aren't in line with the specs:
* If 'stroke-linecap' is set to butt and the given path
segment has zero length, do not draw the linecap for that
segment; however, do draw the linecap for zero-length path
segments when 'stroke-linecap' is set to either round or
square. (This allows round and square dots to be drawn on
the canvas.)

http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes

but for a square dot the orientation is unknown so i think
the specs are better. But horizontal square dots can also be
usable of course.

ps I mailed Dean Jackson about it

Revision history for this message
Piersvdt (piersvdt) wrote :

One part of the bug is fixed in cvs, circles are drawn now,
but the right circle isn't loaded into inkscape, so does not
appear.

The loading is a duplicate of bug #1121631
http://sourceforge.net/support/tracker.php?aid=1121631

So I think this bug is closed now

Revision history for this message
fabb (milkservice) wrote :

As bug #1121631 seems to not exist anymore, and the problem still persists, I've reopened this bug.

The right circle still isn't shown or loaded into Inkscape. It displays correctly in Firefox 4.0b7.

Furthermore, Inkscape does not allow to draw paths consisting of only one point at all.

Revision history for this message
su_v (suv-lp) wrote :

> As bug #1121631 seems to not exist anymore

That's the number from the old bug tracker at sourceforge. After the migration to launchpad, the bug is at
Bug #166306 “Closepaths are bad implemented”:
<https://bugs.launchpad.net/inkscape/+bug/166306>

(to figure out old -> new bug number, prefix the old one with 'sf' like this:
<https://bugs.launchpad.net/inkscape/+bug/sf1121631>)

su_v (suv-lp)
tags: added: svg
removed: all-platforms exporting
Revision history for this message
fabb (milkservice) wrote :

Could we reopen the bug as the problem still persists? (I have no privileges to do so)

I do *not* think that Inkscape has implemented this correctly.

From the Spec of SVG 1.1 (http://www.w3.org/TR/SVG11/painting.html#StrokeProperties):
A subpath (see Paths) consisting of a single moveto shall not be stroked. Any zero length subpath shall not be stroked if the ‘stroke-linecap’ property has a value of butt but shall be stroked if the ‘stroke-linecap’ property has a value of round or square, producing respectively a circle or a square centered at the given point. Examples of zero length subpaths include 'M 10,10 L 10,10', 'M 20,20 h 0', 'M 30,30 z' and 'M 40,40 c 0,0 0,0 0,0'.

And from the Implementation Notes in the Spec of SVG 1.1 (http://www.w3.org/TR/SVG11/implnote.html#PathElementImplementationNotes°):
If ‘stroke-linecap’ is set to butt and the given path segment has zero length, do not draw the linecap for that segment; however, do draw the linecap for zero-length path segments when ‘stroke-linecap’ is set to either round or square. (This allows round and square dots to be drawn on the canvas.)

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.