canvas.clipPath(mPath0, Region.Op.XOR);
clipPath方法内部有调用checkValidClipOp()方法。
private static void checkValidClipOp(@nonnull Region.Op op) {
if (sCompatiblityVersion >= Build.VERSION_CODES.P
&& op != Region.Op.INTERSECT && op != Region.Op.DIFFERENCE) {
throw new IllegalArgumentException(
"Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed");
}
}
API版本大于28时,只支持Region.Op.INTERSECT和Region.Op.DIFFERENCE,不支持Region.Op.XOR,差集效果怎么实现?
canvas.clipPath(mPath0, Region.Op.XOR);
clipPath方法内部有调用checkValidClipOp()方法。
private static void checkValidClipOp(@nonnull Region.Op op) {
if (sCompatiblityVersion >= Build.VERSION_CODES.P
&& op != Region.Op.INTERSECT && op != Region.Op.DIFFERENCE) {
throw new IllegalArgumentException(
"Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed");
}
}
API版本大于28时,只支持Region.Op.INTERSECT和Region.Op.DIFFERENCE,不支持Region.Op.XOR,差集效果怎么实现?