willowsystems / jSignature

jQuery plugin - draw signature in browser.
720 stars 266 forks source link

Vector data from touch device can greatly exceed the bounds of the canvas size #78

Open g4nym3d3 opened 7 years ago

g4nym3d3 commented 7 years ago

When using jSignature on a Touch-based device (tested with Samsung Galaxy Tab S2 and various Ipads) it is possible for the signor to start the signature in the canvas but move their finger/stylus far out of the bounds and the data continues to be captured. This doesn't occur with mouse-based entry so I can only assume that this has something to do with the device transferring the touch data ignorant of the underlying canvas.

If the signature is rendered to an image, since it is just a snapshot of the canvas it looks just like it does on the screen. If, however, a base30 is exported and then converted into an image later, it will include all the vector data. If the user signs his/her name, then swipes their hand across the screen without lifting their finger I end up with a signature with a long tail that completely skews the dimensions and ability to position the resultant image correctly. I have seen this a number of times now after having captured over 50k signatures.

Is there a relatively straight-forward way to re-impose the canvas dimensions with the correct relative positioning on an image converted from the Base30 file on the server side (.net implementation in this case)? Or is the best way forward to capture the image from the canvas on the client (obviously a lot more expensive all around)?

Thanks very much in advance for any advice you can offer.