-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resizing clears the pad but isEmpty() still returns false #94
Comments
I'm not sure if it's possible to watch changes on canvas... maybe with MutationObserver, but that wouldn't work in IE10 and earlier. Maybe it could simply expose a function that you can call when you resize the canvas element to let the library know that something has changed? Or both - expose a function and use MutationObserver to call it automatically on supported browsers... |
Workaround is not too difficult, though. I've added a SignaturePad.clear() call at the end of the resize routine and that pretty much solves the issue. |
I forgot that |
All in all, because of this and issue #32 I ended up using a helper variable,
and
With that I could then proceed to mark canvas as clear, or, when a signature is present, copy-paste the signature.
As mentioned in #32, copy ends up a bit blurred but it's a whole lot better than losing the signature altogether. Anyways, thanks a ton for a great piece of software, Szymon! |
From my point of view, this resizing should be handled internally somehow, I mean when the page resizes, the canvas should autodraw itself. |
This works a lot better if you store |
Having the same problem: when resizing the signature is lost, can be reproduced at http://szimek.github.io/signature_pad/ |
I ended up adding 2 lines to the resizecanvas() as below and it has worked so far smoothly in IE/FF/Chrome-
|
@niteshluharuka Do you encounter this issue whereby the signature gets blurry upon resize? |
@iamjoyce no, it was a different issue of the entire canvas getting cleared. never encountered blurry issue :) |
Maybe this helps: #33 (comment) |
closing as stale |
//this works for me
|
Can be reproduced at http://szimek.github.io/signature_pad/
Maybe SignaturePad should watch changes on canvas? That way user wouldn't be able to pass en empty signature.
The text was updated successfully, but these errors were encountered: