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

"M0,0ZZZZZZZZZZ" just creates a single subpath "M0,0Z", the extra Z's dont start any new subpath, they terminate an existing open path... if there's one. But it does not drops the initial point of the last processed subpath (so the last "M/m" position is preserved as the last "current point", not really the last "initial position" for the last subpath).

A new subpath however is created by "M/m" or other non-"z/Z" commands: only these commands will see if there's an open path with a "current point": even if the path was closed, there's still the last value of the "current point" resulting from the last processed path.

If you want to have multiple subpaths (because you want to use that path to derive other paths for superposing markers, possibly half-transparent), don't write "M1,2ZZZ" which just generates 1 subpath, but separate each Z by a relative moveto(0,0) or zero-length lineto, for example "M1,2Zh0Zh0Z" which generates 3 subpaths.


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


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

Received on Wednesday, 9 February 2022 00:50:35 UTC