SVG: Drop-Shadow filter pixelates SVG on mobile Safari

后端 未结 3 1295
长情又很酷
长情又很酷 2021-01-03 10:35

I am using a drop shadow filter inside an SVG file that is embedded using an img tag. On my MacBook, it looks fine in Safari. However, in mobile Safari, the gra

3条回答
  •  太阳男子
    2021-01-03 10:50

    This problem is still relevant in 2018, and I've found a solution. You can duplicate the element you give the filter to, place it below the actual element, and keep filter only on it, without any filter on the element. This way, Safari and other browsers will only rasterise the element with the shadow when resizing, however it will be hidden by the sharp-looking vector element. You can see examples and read more here.

提交回复
热议问题