Masking using the imperative API? #810
-
Hi! I'm struggling to re-create a mask from the I've got a path I'd like to mask/clip with a rect (so it never goes outside the rect), how do I go about doing that? I've tried wrapping a Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Your best bet here is to look at the declarative implementation to get a sense of how the masking is implemented: https://github.com/Shopify/react-native-skia/blob/main/package/src/renderer/components/Mask.tsx#L16 This is essentially done using blend modes. |
Beta Was this translation helpful? Give feedback.
-
Can it be done using just a single The following mask does mask, but it also renders the mask (I'd like it to be invisible). Then the path itself is just black instead of yellow.
|
Beta Was this translation helpful? Give feedback.
-
For others: this solves my problem :)
|
Beta Was this translation helpful? Give feedback.
For others: this solves my problem :)
The
Drawing
component doesn't draw outside the clip set by the group.