- In this completely revised version of the signature-pad for Javascript I did these changes:
- First, I sorted and commented the different functions for better insight.
- Then I rewrote most of drawing logic. The original version didn't like dots, so I sorted it out following the cleanest way to do it. In Javascript, the DOWN event has the same coordinates as the first MOVE, and the last MOVE has the same as the UP event, even if there is only a single click, an MOVE event is fired. So, i add points at MOVE events, and at the UP event i decide: If the points array has four members, a bezier curve is drawn until the 3rd point, so I double the last point to draw it to the last position. Three members aren't possible, because then the first point would be doubled to start the bezier. With two members, you can only draw a single line, so I added a function for this and with only one point you need a dot - I added this also.
- consolidated some of the functions to make it cleaner.
- the Pad works now exactly the same way as my fork of the Android version https://github.com/stephanbrunker/android-signaturepad
- cleaned out the repository with only the essentials
- I made up a new fork because my pull request to the upstream repo was denied - perhaps too many changes ...
- Fix
touchend
event on touch devices. (#150) mtomic - Fix handling touch events in Egde browser. (#134) dideldum73
- Prevent loading an empty string in
fromDataURL
. (#108) Remo - Reject points generated by resting hand (better handling of multi touch). (#48 and #57) jurreantonisse
- Prevent duplicate events on tap in iOS Safari. PerfectPixel
- Add
on
method that rebinds all event handlers. Alplob
- Add
off
method that unbinds all event handlers. Rob-ot
- Fix support for Browserify. chevett
- Add support for CommonJS/AMD/UMD.
- Really fix
fromDataURL
on HiDPI screens.
- Fix
fromDataURL
on HiDPI screens.
- Fix
onBegin
andonEnd
callbacks when passed as options to constructor. yinsee
- Fix handling touch events on mobile IE. tocsoft
- Add
onBegin
andonEnd
callbacks. rogerz
- Fix bug where stroke becomes very thin. mvirkkunen
- Fix
SignaturePad#fromDataURL
on Firefox. Fr3nzzy
- Make
SignaturePad#isEmpty
return false after loading an image usingSignaturePad#fromDataURL
. krisivanov
- Fixed
SignaturePad#clear()
.
- Add
backgroundColor
option to set custom color of the background onSignaturePad#clear()
. - Rename
color
option topenColor
. - Fix passing arguments to canvas element on
SignaturePad#toDataURL()
.