szimek / signature_pad

HTML5 canvas based smooth signature drawing
http://szimek.github.io/signature_pad/
MIT License
10.91k stars 2.11k forks source link

fix: prevent division by zero in bezier #785

Closed samvimes01 closed 2 months ago

samvimes01 commented 2 months ago

In some cases Bezier curve calculations could fail due to division by zero. (for example when signature was generated by older version of the lib or another lib with similar approach to saving canvas data like this one http://keith-wood.name/signature.html)

Screenshot 2024-08-23 at 16 29 42

This PR fixes the issue by checking for zero before the division.

github-actions[bot] commented 2 months ago

:tada: This PR is included in version 5.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: