Re: [svgwg] Relax SVG Path grammar with an implicite first MoveTo command (#780)

May be we can say that a "moveto-less" drawing command would be interpreted by dropping the drawing fo the first fragment.
But there's a good reson for saing that allcommands have an implicit origin: see relative commands that are normally based on a *relative* origin at 0,0: this path can still be positioned correctly outside the path itself with x=*" and y=*" values of objects: these paths are relative to the position of the containing element. So the same path for a ring for example could be designed within any explicit origin but just an implicit origin: an initial *relative* moveto could still be applied and become valid (relative to the implicit relative origin at 0,0, the whole path would be relative; it would be drawable at any other position by `<use x="*" y="*" xlink:href="*"/>` referencing the relative path.
In fact relative or absolute "moveto" do not make any difference at start of the path: they would just be relative to the implicit origin (0,0); they are only differentiated at further positions in the path where relative "moveto" are relative to the last current point of the previous fragment, while an absolute "moveto" are relative to the implicit origin at (0,0).
The same applies for other movements with "pen up" like "advance horizontally" (which is not only relative to the previous fragment or implicit origin, but also relative to the previous bearing which oriented the direction), or the "short-hand" arcs that also take an implicit position for the last control point for applying symetries to position the first control point of the next arc)
Note that markers still cause a difficulty: there's no way in existing path to specify a marker-less moveto, it would require a "newpath" command, relative (for "n", relative  to the previous fragment or to the implicit relative origin at 0,0) ot absolute (for "N", relative to the implicit relative origin at 0,0)




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

Received on Friday, 8 May 2020 17:46:22 UTC