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

fine-tune pinch gesture/mouse wheel zoom speed #1089

Closed
n1ru4l opened this issue Feb 21, 2021 · 4 comments
Closed

fine-tune pinch gesture/mouse wheel zoom speed #1089

n1ru4l opened this issue Feb 21, 2021 · 4 comments

Comments

@n1ru4l
Copy link
Member

n1ru4l commented Feb 21, 2021

From Discord:

Alder Agilao: Hi. Zooming on an iPad is incredibly difficult, it zooms and zooms out way to much. Any better way to control? Using an iPad to out to a tv for my group

jeepinbird: I second this. Pinch zooming goes really fast but using the buttons works great.

Relevant code:

const pinchScale = Math.max(0.1, Math.exp(wheel * 0.5) * scale);

const pinchScale = Math.max(0.1, Math.exp(wheel * 0.5) * scale);

@n1ru4l n1ru4l added this to the v1.13.0 milestone Feb 21, 2021
@n1ru4l n1ru4l changed the title fine-tune pinch gesture/mosue wheel zoom speed fine-tune pinch gesture/mouse wheel zoom speed Feb 21, 2021
@maxb2
Copy link
Member

maxb2 commented Feb 22, 2021

The exponential function might be the problem 🙈

@maxb2
Copy link
Member

maxb2 commented Feb 22, 2021

My guess is that the scroll wheel on a mouse changes in small, discrete, and predictable steps, while the pinch gesture can vary a lot. The exponential function will wildly exaggerate whatever wheel is doing.

@n1ru4l
Copy link
Member Author

n1ru4l commented Feb 23, 2021

The wheel variable does have either the value -1 or 1 for both wheel and mouse zoom. There is not really a right speed, only too fast or too slow, so I feel it is a bit of a hard task to figure out the "correct" value, especially since I did not perceive stuff as too fast 😅

@maxb2
Copy link
Member

maxb2 commented Feb 23, 2021

Hmm, maybe the pinch gesture has a higher sample rate than a wheel scroll and that leads to the difference in perceived speeds.

@n1ru4l n1ru4l modified the milestones: v1.13.0, v1.14.0 Mar 16, 2021
@n1ru4l n1ru4l modified the milestones: v1.14.0, v1.13.0 Mar 27, 2021
@n1ru4l n1ru4l closed this as completed in 62d47e8 Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants