如何在 SVG 中删除两个相邻多边形之间的线:
<svg width="200px" height="200px" viewBox="0 0 200 200">
<polygon points="100 100, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
<polygon points="200 200, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
</svg>
在这种情况下,可以通过合并两个多边形来解决 - 但如果多边形具有不同的颜色,则情况并非如此。
它是抗锯齿的,所以形状渲染="crispEdges"将是修复它的一种方法。
<svg width="200px" height="200px" viewBox="0 0 200 200" shape-rendering="crispEdges">
<polygon points="100 100, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
<polygon points="200 200, 100 200, 200 100" style="fill: blue; fill-opacity: 1; stroke: black;stroke-width: 0;" />
</svg>