删除 SVG 文件中的转换 [英] Removing transforms in SVG files
问题描述
我已经为此苦苦挣扎了一段时间,似乎在任何地方都找不到(有效的)答案.我有一个像这样的 SVG 文件:
I have been struggling with this for a while, and can't seem to find an answer (that works) anywhere. I have an SVG file which looks like this:
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
...
width="72.9375"
height="58.21875"
...>
...
<g
...
transform="translate(10.75,-308.96875)"
style="...">
<path
inkscape:connector-curvature="0"
d="m -10.254587,345.43597 c 0,-1.41732 0.17692,-2.85384 0.5312502,-3.5625 0.70866,-1.41733 2.14518,-2.82259 3.5625,-3.53125 1.41733,-0.70866 2.11392,-0.70867 3.53125,0 1.41732,0.70866 ... z"
... />
</g>
</svg>
我想删除 transform="..."
行,但我的图像仍然保留在我放置它的位置(在 InkScape 中).如果我手动删除转换,图像会压缩到屏幕的另一部分(如预期的那样),但我需要完全摆脱转换,同时让图像完全停留在我想要的位置.有没有办法将变换移除/展平为路径坐标本身?(我唯一需要处理的转换是平移和缩放,没有矩阵.)
I want to remove the transform="..."
line but still have my image stay where I've placed it (in InkScape). If I manually remove the transform, the image zips to another part of the screen (as expected), but I need to get rid of the transform altogether and, at the same time, have the image stay exactly where I want it. Is there a way to remove/flatten the transforms into the path coordinates themselves? (The only transforms I have to deal with are translate and scale, no matrices.)
推荐答案
如何在 Inkscape 中移除 transforms
- 在 Inkscape 中打开 svg 文件
- 转到编辑 ->全选
- 转到对象 ->取消组合
- 转到编辑 ->XML 编辑器
- 找到转换"图层中的属性并删除它们
如何在不创建其他变换属性的情况下完全移动所有对象
- 转到编辑 ->在所有图层中全选
- 转到对象 ->变换
在变换"面板中
- 取消选中相对移动并选中分别应用于每个对象
- 根据您的需要设置水平和垂直值,然后点击应用
- Uncheck Relative move and check Apply to each object separately
- Set Horizontal and Vertical values according to your needs and click Apply
这篇关于删除 SVG 文件中的转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!