SVG animations artifacts on Safari

允我心安 提交于 2021-01-29 02:05:02

问题


I'm using d3.js to do some svg layout/animations and am running into the problem described by the first example here (only on Safari / Safari mobile):

http://www.mysparebrain.com/svgbug.html

(e.g., when the rect+text moves, it leaves rendering artifacts in its path)

Does anyone know of a workaround for this?

The only similar question on SO I could find is this unanswered one:

Canvas draws artifacts in Safari for animated, filled bezier curves


回答1:


You should definitely file a WebKit bug report on this. You've already reduced it to a very clear test case, so that should make it easier for someone to fix it.

Anything that forces a redraw based on horizontal positioning seems to fix it. I noticed just by switching to another tab and back caused it to redraw. What about doing a reposition of the content area, e.g., move right 1px then left 1px, to force a redraw? It's not pretty, but it's better than artifacts.



来源:https://stackoverflow.com/questions/11423756/svg-animations-artifacts-on-safari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!