问题描述
我有一些带有线标记的 SVG 线,我有一个脚本可以移动这些线.这适用于所有浏览器,包括 IE9.
I have some SVG lines with line markers on them, and I have a script that moves those lines around. This works fine on all browsers, including IE9.
但是,我只是在 IE10 上尝试过,当线条移动时,线条标记会被留下.
However, I just tried it on IE10, and the line markers get left behind when the line moves.
一个例子可以在这里看到:http://jsfiddle.net/swYRK/8/
An example of this can be seen here: http://jsfiddle.net/swYRK/8/
我在 Windows 7 和 8 上都试过了.
I have tried this on both Windows 7 and 8.
有人知道这是怎么回事吗?这是 IE10 的错误,还是有其他方法可以移动线条和标记?
Anyone know what's going on? Is this an IE10 bug, or is there another way to move the line and markers?
(请注意,实际应用程序对性能非常敏感,因此我非常希望避免在移动线条时每帧重新创建线条之类的操作.)
(Note the actual application is very performance sensitive, so I very much want to avoid doing something like re-creating the lines every frame while I move them, or something.)
-
这似乎是一个真正的 IE 10 错误.我发现了一个 IE 错误跟踪器中的未解决问题(需要 Microsoft 帐户才能查看,这使它对 Google 不可见.您好?),我已向其中添加了信息.IE 尚未接受该问题.
this seems like a real IE 10 bug. I've found one open issue in the IE bug tracker (which requires a Microsoft account to even see, which makes it not visible to Google. Hello?), which I have added information to. IE has yet to accept the issue.
如果人们能想到任何其他变通办法,那就太好了.完全删除结束标记,渲染它,然后重新添加它们是可行的(显示可见的闪烁),但在 我的申请.
If there are any other work-arounds that people can think of, that would be great to hear. Completely removing the end markers, rendering that, and then re-adding them works-ish (shows visible flashing), but would not be acceptable in my application, unfortunately.
推荐答案
这是一种快速的方法,效果很好.我没有注意到任何闪烁或与性能相关的问题.
This is a quick way of doing it, that works well.I have not noticed any flickering or performance related issues.
只需在原来的位置重新添加 svg 节点:
Simply re-add the svg node in it's original place:
if (navigator.appVersion.indexOf("MSIE 10") != -1) {
svgNode.parentNode.insertBefore(svgNode, svgNode);
}
当然,您可以使用任何浏览器嗅探选择..
Of course, you could use any browser sniffing of choice..
这篇关于当 IE10 中的线条移动时,SVG 线条标记不更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!