通常,该<clipPath>
元素会隐藏剪辑路径之外的所有内容。为了达到相反的效果——即从图像中“剪掉”一些东西——我想在 clipPath 和clip-rule="evenodd"
属性中使用两条路径。基本上,我想“异或”剪辑路径。
但它不起作用。它显示区域“ORed”:
<clipPath clip-rule="evenodd" id="imageclippath" clipPathUnits = "objectBoundingBox">
<rect clip-rule="evenodd" x="0.3" y="0.3" height="0.6" width="6" />
<rect clip-rule="evenodd" x="0" y="0" height="0.5" width="0.5" />
</clipPath>
<rect clip-path="url(#imageclippath)" x="0" y="0" height="500" width="500" fill="red"/>
编辑:
我的问题是 AFAIK<mask>
在 iOS WebKit 中不起作用。