是否有将整个SVG路径移动到新位置的命令

Is there a command to move the whole SVG path to a new position?

本文关键字:新位置 位置 命令 移动 路径 SVG 是否      更新时间:2023-09-26

是否有将整个SVG路径移动到新位置的命令,而不是将偏移量添加到路径的每个点?

感谢她的评论。解决方案是:将路径封装到

<g transform="translate(offset_x,offset_y)"></g>
<path transform="translate(x, y)" d="....">

如果你的路径已经有了变换,而你不想干涉它们:

<g transform="translate(x, y)">
    <path transform="..." d="....">
</g>

抄袭Phrogz的评论和Powerboy的回答