Skip to content
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

fix: prevent division by zero in bezier #785

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

samvimes01
Copy link
Contributor

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.

Copy link
Collaborator

@UziTech UziTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you add a test?

@UziTech UziTech merged commit 1ca425e into szimek:master Aug 23, 2024
5 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 23, 2024
## [5.0.3](v5.0.2...v5.0.3) (2024-08-23)

### Bug Fixes

* prevent division by zero in bezier ([#785](#785)) ([1ca425e](1ca425e))
Copy link

🎉 This PR is included in version 5.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants