mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-31 21:58:01 +00:00
add clipping js code
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import SerializablePath from 'react-native/Libraries/ART/ARTSerializablePath';
|
||||
|
||||
const clipRules = {
|
||||
evenodd: 0,
|
||||
nonzero: 1
|
||||
};
|
||||
|
||||
export default function (props) {
|
||||
let {clipPath, clipRule} = props;
|
||||
let clippingProps = {};
|
||||
|
||||
if (clipPath) {
|
||||
clippingProps.clipPath = new SerializablePath(clipPath).toJSON();
|
||||
clippingProps.clipRule = clipRules[clipRule] === 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
return clippingProps;
|
||||
}
|
||||
Reference in New Issue
Block a user