【发布时间】:2013-03-13 00:10:09
【问题描述】:
在模式中使用 vector-effect="non-scaling-stroke" 时,我在 Firefox 或 Chrome 中没有得到预期的结果,尽管 Opera 按预期工作...
例子:
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" height="100px" width="1000px">
<defs>
<pattern id="ticks" viewBox="0 0 12 4" preserveAspectRatio="none" height="100%" width="10%">
<path stroke="#000" vector-effect="non-scaling-stroke" d="M 0 0 L 0 4 M 1 0 L 1 1 M 2 0 L 2 1 M 3 0 L 3 2 M 4 0 L 4 1 M 5 0 L 5 1 M 6 0 L 6 3 M 7 0 L 7 1 M 8 0 L 8 1 M 9 0 L 9 2 M 10 0 L 10 1 M 11 0 L 11 1" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#ticks)" />
Screenshot of results in Firefox, Chrome and Opera
是我做错了什么,还是 WebKit 和 Gecko 中的错误?如果是错误,是否有人知道解决方法?
感谢您的帮助。
【问题讨论】:
-
你定义了笔画宽度吗?
-
另见stackoverflow.com/questions/10473328/…。由于模式不在 SVG Tiny 1.2 中,因此未定义非缩放笔画应该如何在那里工作,我认为 SVG2 也没有定义。
标签: svg