Repository navigation
Replies: 2 comments
|
Hello, Thank you for reaching out to us. We do not have any provision to check if the canvas contains any drawing as of now. However, this is something we could take up. Could you please let us know if this is a requirement and which business unit is this requirement coming from ? |
|
Hi @SUBBH-Equinor , Thank you for your quick reply, and for considering this as a potential improvement. Yes, this is a requirement for our use case. From a business point of view, the requirement comes from a need to ensure that a captured “signature” is not empty (for legal and UX reasons). At the moment we plan to implement a workaround on our side (for example by tracking whether the user has actually drawn any stroke), but having first-class support in mad (e.g. a method or state indicating whether the canvas is empty) would make the implementation more robust and reusable. Thank you again for the great work on this library, and for considering this feature. Best regards, |
Uh oh!
There was an error while loading. Please reload this page.
Hi team,
First of all, thank you for your work on the library @equinor/react-native-skia-draw – it has been very helpful for our project.
I am using mad to build a manual signature component (similar to a “signature pad”), where the user can draw a signature on a canvas and then confirm it by pressing a button.
To enable/disable this button, I would like to know whether the canvas is “empty” (no strokes drawn yet) or not. However, I noticed that even when the canvas is visually empty, the return value of the makeImageSnapshot() function is not empty, so I cannot use that directly to determine if the user has drawn something.
My questions are:
Is there a recommended way in mad to check whether the canvas contains any drawing (e.g. any strokes) before calling makeImageSnapshot()?
If not, do you have a suggestion or best practice for how to implement this check with the current API?
Thanks again for providing and maintaining this library, and thanks in advance for any guidance you can give.
All reactions