gpt4 book ai didi

html - SVG 路径 "d"元素需要以 "M"开头还是 "m"足够好?

转载 作者:行者123 更新时间:2023-12-05 01:44:55 26 4
gpt4 key购买 nike

我知道 SVG 中的第一条路径应始终以 M 开头。 (即绝对命令)

不过,假设单个 SVG 中有多个路径。其他路径能否以 m 开头(即命令的相对移动)以便从先前路径的端点开始?

我知道这可以通过将第二条路径的数据移动到第一条路径的末尾来实现,但在我的情况下这是不可能的。

感谢您的帮助!

最佳答案

路径开始处的相对(小写 m)moveto 将被解释为绝对(大写 M)moveto,尽管在最初两个之后的后续坐标对将被视为相对lineto的。它们不会被视为在上一个路径命令结束时开始绘图的指示。来自spec :

Start a new sub-path at the given (x,y) coordinate. M (uppercase) indicates that absolute coordinates will follow; m (lowercase) indicates that relative coordinates will follow. 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. If a relative moveto (m) appears as the first element of the path, then it is treated as a pair of absolute coordinates. In this case, subsequent pairs of coordinates are treated as relative even though the initial moveto is interpreted as an absolute moveto.

关于html - SVG 路径 "d"元素需要以 "M"开头还是 "m"足够好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44170324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com