Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firefox/Safari问题中的SVG过滤器_Firefox_Svg - Fatal编程技术网

Firefox/Safari问题中的SVG过滤器

Firefox/Safari问题中的SVG过滤器,firefox,svg,Firefox,Svg,我在Firefox和Safari中应用feColorMatrix时遇到问题。它在Chrome中工作正常。我的目标是减轻一点阴影,这可以通过改变阴影颜色或其不透明度来实现。我决定改变不透明度。在Firefox和Safari中,在我使用feColorMatrix之后,SVG被完全忽略。代码: <filter id="AI_Shadow_1" filterUnits="objectBoundingBox" > <feGaussianBlur in="SourceAlpha" st

我在Firefox和Safari中应用feColorMatrix时遇到问题。它在Chrome中工作正常。我的目标是减轻一点阴影,这可以通过改变阴影颜色或其不透明度来实现。我决定改变不透明度。在Firefox和Safari中,在我使用feColorMatrix之后,SVG被完全忽略。代码:

<filter  id="AI_Shadow_1" filterUnits="objectBoundingBox" >
<feGaussianBlur  in="SourceAlpha" stdDeviation="8" result="blur"></feGaussianBlur>
<feOffset  in="blur" dx="18" dy="18" result="offsetBlurredAlpha"></feOffset>
<feMerge>
    <feMergeNode  in="offsetBlurredAlpha"></feMergeNode>
    <feMergeNode  in="SourceGraphic"></feMergeNode>
</feMerge>
<feColorMatrix in="the-shadow" result="color-out" type="matrix"
  values="0 0 0 0   0
          0 0 0 0   0 
          0 0 0 0   0 
          0 0 0 0.2 0"/>
 <feBlend in="SourceGraphic" in2="color-out" mode="normal"/>
</filter>

如果有更有效的方法来减轻阴影并在浏览器间工作,那么我非常乐意使用它

干杯

feColorMatrix

 in="the-shadow"
应该是

 in="blur"

这应该行得通,请创建一个,尽管现在我看得更仔细了,阴影定义为输出在哪里?feMerge应该是feMerge result=“the shadow”[虽然它不是真正的阴影-它是与源合并的阴影。-你应该将feColorMatrix放在偏移量和合并之间,并删除最终的混合。