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

fixing bug in pinch to zoom: #182

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

HabelFLX
Copy link

@HabelFLX HabelFLX commented May 24, 2023

I came across a bug on moble devices related to the Pinch to Zoom feature:
Once the user starts to zoom using two fingers the scale is only adjust in one direction (zoom in) - to zoom out was not possible.

This PR addresses this problem by:

  • avoid using changedTouches on touch events since we rely on information of two touchpoints in every usecase (i.e. changedTouches only contains touchpoints that changed but to calculate the distance between 2 points, we rely on both)
  • Passing fake clientX and clientY properties to zoom function when using pinch to zoom since property is required to focus on a specific location on the loaded image (for sure we could also add new parameters to the zoom function to overwrite the clientX and clientY values used in that function).
  • adding new parameter to adjust the force by which the zoom factor is being calculated (to avoid generating huge zoom factors even if the fingers were only slightly moved)

Btw: This seems to be the same bug mentioned in issue #151

avoid using changedTouches on touch events since we rely on information of two touchpoints always
Passing fake clientX and clientY properties to zoom function when using pinch to zoom since property is required to focus
adding parameter to adjust the force by which the zoom factor is being calculated
@HabelFLX
Copy link
Author

Hey guys!
Any chance someone can take a look at this? :-)

@ivictbor ivictbor merged commit 19d32b1 into devforth:master Jul 31, 2023
@ivictbor
Copy link
Collaborator

Hey @HabelFLX sorry for long delay, merging now!

@ivictbor
Copy link
Collaborator

@HabelFLX Released .82 now

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