在 IE9 中渲染具有清晰边缘的 SVG 形状
IE9 似乎不支持 SVG shape-rendering="crispEdges"
属性。
下面是一个 SVG 示例:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg" height="600" id="svgroot" version="1.1" width="800" x="0" y="0">
<line style="stroke:#000000;stroke-width:1px;stroke-opacity:1" y2="300" y1="300" x2="750" x1="50" shape-rendering="crispEdges" />
</svg>
它在 Firefox 和 Safari 下正确显示,但在 IE9 和 IE10 下线条显得模糊(平台预览)
是否有一些解决方法可以禁用 IE9 中的抗锯齿功能?
谢谢!
IE9 appears not to honour the SVG shape-rendering="crispEdges"
attribute.
Here's a sample SVG:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg" height="600" id="svgroot" version="1.1" width="800" x="0" y="0">
<line style="stroke:#000000;stroke-width:1px;stroke-opacity:1" y2="300" y1="300" x2="750" x1="50" shape-rendering="crispEdges" />
</svg>
It appears correctly under Firefox and Safari, however the line appears blured under IE9 and IE10 (Platform preview)
Is there some workaround to disable the anti-aliasing in IE9?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够仅将线条垂直移动 0.5“像素”,而不是使用形状渲染。这样,这条线至少在所有非 IE 浏览器中看起来都会很清晰。
You should be able to just shift the line 0.5 "pixels" vertically instead of using shape-rendering. That way the line will look sharp in all non-IE browsers at least.