我有由多个多边形组装而成的 SVG。我试图将图像/按钮放在多边形中心内,但我尝试过的总是将图像放在x=0 and y=0
屏幕上。
<Svg width="546px" height="794px" viewBox="0 0 546 794" version="1.1" >
<G id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<G id="item0" transform="translate(1.000000, 1.000000)" fill="#EDAF51" fill-rule="nonzero" stroke="#720D00">
<Polygon id="RX-03" points="206.65269...">
</Polygon>
<Circle x="0" y="0" cx="40" cy="40" r="15" fill="black" />
</G>
有了这个,我得到:
但如果我把<Circle x="110" y="0"
我得到
这是正确的,但我不想使用 x=110 我试图让这个圆相对于它的父多边形。所以我可以将 circle 设置为 x=0 y=0 并将其保持在父多边形的区域内。