Re: [svgwg] Is "M0,0L100,0ZL100,50L200,200ZL,0,200Z" 1 subpath or 3? (#866)

`Z` closes a sub-path but then *any* new segment appears to start a new subpath. The first full path must start with M but later subpaths do not have the same requirement. 

Functionally I can find nothing to determine any difference here. Markers, stroke-linejoin, and fills all work identically as simple and compound paths. The only implementation of this is within Inkscape which interprets `closepath` as ending a path and any segment after that close, when the paths are broken apart.

Having read it several times I must conclude that it is 3 subpaths. Z does not start the new path but it does terminate the old one. `M0,0ZZZZZZZZZZ` is 10 different highly unusual subpaths most of them consisting of just a close statement.

Part of the confusion is the use of "next subpath" and "current subpath" when we're talking about `closepath` followed by a non-`moveto` command. We are just talking about a Z but a Z followed immediately by any other command. The additional Z didn't start a new path, but the additional command *did* start a new subpath.

> "If a "closepath" is followed immediately by a "moveto", then the "moveto" identifies the start point of the next subpath. If a "closepath" is followed immediately by any other command, then the next subpath starts at the same initial point as the current subpath."

If a "closepath" is followed by any command it begins a new subpath. If it begins with a move, this new subpath begins at the point specified by the `moveto`. If it begins with any other command, the new subpath began at the same initial point as the previous subpath. The first subpath (if there is one) must begin with a `moveto`.

There's enough details to piece this together but it took a bit of reading between the lines.

-- 
GitHub Notification of comment by tatarize
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/866#issuecomment-922660214 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 20 September 2021 06:12:12 UTC