SVGPath icon indicating copy to clipboard operation
SVGPath copied to clipboard

Treat further coordinates following moveTo command as lineTo command

Open daiku60 opened this issue 7 years ago • 2 comments

As sated here the moveTo command (m/M), when followed by more than one pair of coordinates, assumes the command to be a lineTo (l/L) instead. Currently the library treats it as other moveTo, so it does not draw paths starting with lines. This behaviour is what inkscape does by default, so it is not possible to draw a line from its source directly.

It may be useful to make the code conform to this pattern, as it is the way inkscape saves the elements.

daiku60 avatar Jul 13 '17 12:07 daiku60

Yeah, looking at https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands, I see the same thing.

If a moveto is followed by multiple pairs of coordinates, the subsequent pairs are treated as implicit lineto commands. Hence, implicit lineto commands will be relative if the moveto is relative, and absolute if the moveto is absolute.

Marking as a bug.

timrwood avatar Jul 13 '17 15:07 timrwood

Too bad this bug is still open! Android platform has fixed this issue in their code PathParser.java

nsreenath avatar Feb 09 '18 15:02 nsreenath