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

Prevent dividing by 0 in for touch gestures #7607

Merged
merged 3 commits into from
Jan 13, 2022
Merged

Conversation

rockerBOO
Copy link
Contributor

In scenarios where the distance resolves to 0 as not moved from the same point.

start.x - self.x, start.y - self.y where start and self are the same numbers will make distance 0.

start.distance = Math.sqrt(0 * 0 + 0 * 0)

In scenarios where the distance resolves to 0 as not moved from the same point. 

`start.x - self.x, start.y - self.y` where start and self are the same numbers will make distance 0. 

`start.distance = Math.sqrt(0 * 0 + 0 * 0)`
@asturur
Copy link
Member

asturur commented Jan 13, 2022

This seems fine to me!

@asturur asturur merged commit 9d8fce4 into fabricjs:master Jan 13, 2022
@asturur asturur mentioned this pull request Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants