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

throttled onwheel event #516

Merged
merged 2 commits into from
May 27, 2021
Merged

throttled onwheel event #516

merged 2 commits into from
May 27, 2021

Conversation

kwcantrell
Copy link
Collaborator

I don't know if this an issue was created for this but I just tried using empress on a mac laptop and the zoom functionality was incredibly sensitive, which caused the tree to zoom in/out incredibly fast. This PR fixes that issue by throttling the .onwheel event to fire at most 1 every 50 milliseconds.

@kwcantrell
Copy link
Collaborator Author

McHelper is failing to connect (see #517) which is causing the build to fail.

@fedarko
Copy link
Collaborator

fedarko commented May 21, 2021

Nice catch, thank you!

Not to split hairs, but would a slightly lower throttle value be ok? On an Ubuntu laptop, 50 ms seems too jerky for me (compared to the previous settings) -- 10 ms feels better. (I captured two GIFs comparing the settings, but I'm not sure these will be useful due to frame-rate stuff...)

50 ms 10 ms
t50 t10

I guess we should ideally try to pick the lowest value that allows Mac users to control things well. That all being said, I suspect that there probably isn't a "perfect" value here, especially since lots of things like touchpad sensitivity are up to the user -- I'm fine choosing a setting that works reasonably well for both of us, and in the future we could make this configurable in the side panel or something if desired.

McHelper is failing to connect (see #517) which is causing the build to fail.

Weird -- not sure why this is happening. In any case, this PR looks fine, so I'm happy to merge it in when we agree on a value.

@kwcantrell
Copy link
Collaborator Author

agreed @fedarko, ideally there should be some 'sensitivity' adjuster. I lowered the throttle to 10. I tried lower numbers (as I felt my normal laptop worked perfect before the throttle) but it seemed a bit fast for mac. So, 10 seems to be the optimal number to make everyone happy.

@fedarko
Copy link
Collaborator

fedarko commented May 27, 2021

Thanks @kwcantrell!

@fedarko fedarko merged commit 4f8db9d into biocore:master May 27, 2021
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