-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
fromDataURL()
scaling issue
#6
Comments
this seems to be related to szimek/signature_pad#332, szimek/signature_pad#265, szimek/signature_pad#255, szimek/signature_pad#200 , szimek/signature_pad#153 , szimek/signature_pad#105 , szimek/signature_pad#89 which are related to the scaling that |
Hi @sheam -- I just released v1.0.0-alpha.1 which now fully wraps the original signature_pad (per #17 / #20 ). The functionality to support custom options passed into I think this resolves the problem, but requires manual intervention. Handling this properly / automatically would be preferred, so I'll leave this issue open as such. |
I revisited this recently and I realized that I'm not sure more can even be done to handle DPR automatically. There's no way of knowing the DPR at which the dataURL was created, so I think the new options that allow you to specify it manually resolve the issue correctly. It's possible the default DPR for Will be closing this out now. |
I fixed this by making sure the height and the width of the sigPad is the same as when I initialized it.
|
When I restore using fromDataURL(), the restored signature is about 1/4 size it was drawn in.
render the Signature Pad like this:
And my save method looks like this:
For testing purposes, I am just doing toDataURL(), clearing canvas, then restoring the contents. The restored drawing is shrunked by a factor of DPR. For example in the Chrome device emulator the iPhone 6 has a DPR of 2.0, so on save/restore the result is half ths size I drew it.
How do I handle this situation so the sigature remains the same size on save/restore on a phone?
The text was updated successfully, but these errors were encountered: