-
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
i use fromData after toData, and the draw is not completely the same . #270
Comments
Most likely it's a bug - probably not all data points are stored (the ones at the end of each stroke) and thus when recreating an image from these points, each line is a bit shorter. |
@szimek thanks for reply. I will take some time try to fix the bug. By the way, signature pad is a wonderful JavaScript library. |
@szimek
|
I also met for this problem. |
@szimek It seems that , this bug is not fixed . html dom:
I used 2.2.1 a moment ago , I see this bug again . |
@tempbing I don't - check out the jsfiddle (https://jsfiddle.net/h80phxyr/7/) posted by @c4cat. It works fine now. Are you sure that you're using version 2.2.1? @tempbing Could you update this jsfiddle and try to replicate your issue there? |
@szimek I'm sure , and my step like these .. You can see the bug in any step . Others: |
@szimek A new Demo (https://jsfiddle.net/h80phxyr/10/) |
Here's a fixed version: https://jsfiddle.net/szimek/h80phxyr/11/ You need to set canvas size in CSS and adjust its size in JS as well. The canvas size adjustment code is based on the code from the demo (https://github.com/szimek/signature_pad/blob/master/example/js/app.js#L11-L19). |
@szimek |
@tempbing Nah, you're right. It's much less noticeable now, but something is still off. I'll check it out. |
@szimek , am displaying image on signature-pad...when i draw only on signature-pad and do undo() operation it perform correctly..but when am displaying image on signature-pad and then perform undo then it clear entire image first and then other data..i want to undo only data on image..not an image
} private createFileName() { and my perform()-undo function
please help me to correct my perform() function |
@amolumesh12 I'm not sure if there's an easy way to do it at the moment, because Currently, you could modify the library to remove |
can you please make changes in my code for undo operation because..sorry , but am not getting what you trying to say ?? |
There is one working solution for what you are desiring.
Here is an example with TS:
|
How about we add an optional parameter to fromData() like "doNotClear?:Boolean". It wont break the existing code and will be more flexible.
|
I don't know why i get data and set data will make the draw different.(the line will become shorter)
I make a demo here https://jsfiddle.net/h80phxyr/7/
There is the pic compare.
https://i.stack.imgur.com/fLNmM.png
https://i.stack.imgur.com/bleJn.png
I use v2.2.0 and chrome 58
Many thanks!
The text was updated successfully, but these errors were encountered: