【发布时间】:2020-07-16 23:13:45
【问题描述】:
我有两种形状:圆形和矩形。想把它们转换成一个数字。有什么方法可以在 SVG 代码中做到这一点?
<svg width="400" height="400">
<defs>
<g id="shape" fill="none" stroke="red">
<rect x="40" y="50" width="40" height="70" />
<circle cx="50" cy="50" r="50" />
</g>
</defs>
<use xlink:href="#shape" x="50" y="50" />
<use xlink:href="#shape" x="200" y="50" />
</svg>
像这样:
【问题讨论】:
-
我想对这些形状应用阴影滤镜,但我只希望外边框而不是内边框。我希望它是一个完整的形状,但绘制为两个 svg 部分。
-
使用AI(compound path -> make),会在svg export中制作path属性
-
Artem,没办法用AI,需要JavaScript/HTML代码