通常,<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"/>
Run Code Online (Sandbox Code Playgroud)
编辑:
我的问题是AFAIK <mask>在iOS WebKit中不起作用.