开发者

Can an SVG <path> contain both absolute and relative commands?

开发者 https://www.devze.com 2023-01-05 09:30 出处:网络
Currently I\'m developing an app that converts svg-paths created by Inkscape. Now I\'m not clear about the path specification regarding absolute and relative path-combinations. Does the specification

Currently I'm developing an app that converts svg-paths created by Inkscape. Now I'm not clear about the path specification regarding absolute and relative path-combinations. Does the specification say anything about a path definition, that holds relative and absolute coodinates at the same time?

Espacially the case regarding an absolute bezier curve followed by a relative shorthand bezier curve ?

If this case is possible, then I have to compute and keep the current absolute path to make sure I can compute the first controle point of a relati开发者_运维技巧ve shorthand curve.

Should I ask the question the Inkscape authors ?


Yes mixing absolute and relative path commands is allowed. If you are implementing a tool I'd advise you to read the specification, and the path data section in particular.


yes, it can. using upper and lower case commands like l and L (which means line to) in svg path data works for ex d="M 10,10 L 20,20 l 20,20" (M) moves the pen to (10,10) absolute point then (L) draws a line from (10,10) to (20,20) absolute points and finally (l) draws a line from (20,20) absolute point to (20,20) relative point which is (40,40) absolute point

0

精彩评论

暂无评论...
验证码 换一张
取 消