2016-08-23 63 views
1

我有一个动态的d3.js树,我将点亮滤镜应用到元素上。当我缩放树并单击任何节点时,元素将隐藏而不是突出显示。这只发生在Firefox中。在铬它工作正常。svg过滤器在变焦后不能在mozilla firefox中工作

<filter id="yellow-glow" x="-5000" y="-5000" width="10000" height="10000" filterUnits="userSpaceOnUse"> 
    <feFlood result="flood" flood-color="yellow" flodd-opacity="1"/> 
    <feComposite in="flood" result="mask" in2="SourceGraphic" operator="in"/> 
    <feMorphology in="mask" result="dilated" operator="dilate" radius="2"/> 
    <feGaussianBlur in="dilated" result="blurred" stdDeviation="5"/> 
    <feMerge><feMergeNode in="blurred"/> 
    <feMergeNode in="SourceGraphic"/></feMerge> 

这里是working demo

回答

1

当你降低滤波器的尺寸

<filter id="yellow-glow" x="-500" y="-500" width="1000" height="1000" 

我猜的东西是在Firefox中的SVG渲染器溢出它工作正常。您可能想向Mozilla提交错误。

+0

谢谢:)它的工作 – Jerry

+0

理想情况下应该是过滤元件的x,y,宽度和高度值。我的d3树可以拖动和缩放 – Jerry

相关问题