abetusk / www.meowcad.com

website for www.meowcad.com
GNU Affero General Public License v3.0
46 stars 8 forks source link

Zoom with Apple trackpad works poorly #24

Closed dronir closed 9 years ago

dronir commented 9 years ago

I tried using the Meowcad circuit designer in Chrome with an Apple Magic Trackpad (on a Macbook Pro running Yosemite). Using the scrolling gestures to zoom did not really work. The trackpad seems to send events very rapidly, which causes the zoom to be super sensitive and will easily either zoom all the way out or all the way in, or jump in unpredictable directions in a twitchy way, making it very hard to work.

Since I could not find any keyboard shortcuts to move the view around or zoom, or to reset the view to fit the current circuit (like pressing space in LTSpice), the whole thing was pretty much unusable. Either fixing the trackpad or adding keyboard shortcuts to move the view would be a fix.

abetusk commented 9 years ago

Thank you for submitting this issue.

This is a known issue, see https://github.com/abetusk/bleepsix/issues/65 (and the newly created https://github.com/abetusk/bleepsix/issues/77). There are some keyboard shortcuts to zoom ('<' and '>', with or without shift key so ',' and '.' also work) but those need to be documented better (https://github.com/abetusk/bleepsix/issues/76).

I'll keep this issue open for now but the underlying issues are in the 'web app' portion in bleepsix.

abetusk commented 9 years ago

https://github.com/abetusk/bleepsix/issues/76 closed (adding hot keys to help screen)

abetusk commented 9 years ago

@dronir I've clamped the 'delta' in the mouseWheel callback to be in the range of [-1,1]. On my chromebook at least, that delta was much higher making it zoom all the way out or in. If that was the issue for your Apple trackpad, that should solve the issue. If the Apple trackpad is just generating a load of mouse wheel events then I'll have to put in some debounce and rate limit logic.

The change has been deployed. Can you see if it's any better on your system?

dronir commented 9 years ago

Thanks for the pointers, I'll submit future issues to the proper repo's issue tracker.

It's better, but still not really functional. It doesn't jump to extremes anymore, but it's very jittery. Making short scrolling gestures might take me in the right direction, but quite often the result is just random. A long smooth scrolling movement just seems to random walk, resulting sometimes in zero net zoom, sometimes as a pretty long zoom in the wrong direction etc.

abetusk commented 9 years ago

@dronir I think this is a deeper issue with using trackpads. I use jquery-mousewheel and you can see the discussion over there about how to try to deal with mouse wheel vs. trackpads: https://github.com/jquery/jquery-mousewheel/issues/36.

I've been playing around with various tweaks (using jquery-mousewheel's new deltaFactor and making sure it's big enough, discarding events that are too close together, etc.) but none of them looks to make the trackpad (that I have on my Chromebook) work as intended.

I'm sorry but at this point I don't know what to do. As far as I can tell there's no consistent way to tell that the user is using a trackpad over a mouse. I'm open to suggestions on what acceptable solutions are but I have no other ideas.

Maybe at some point in the future we'll have better browser polling features on what input device is used but in the mean time you can use the hot keys '<' and '>' to zoom out and in.

I'll wait a little while but if I haven't heard anything by tomorrow I'll close this and put a 'wontfix' label on it. If something changes (either a library/policy does exist to correctly handle trackpads or new features are added) I'll re-open and/or revisit this issue.

dronir commented 9 years ago

Ok, that's a shame, but can't help it I guess. Using the keyboard is ok, but in that case some improvement to the keyboard controls would be nice. I'll make an issue about those on the other repo for further discussion.

dronir commented 9 years ago

Btw, I find my trackpad zooming a lot smoother today than yesterday. Still a bit twitchy, but much more useable now.

abetusk commented 9 years ago

See https://github.com/abetusk/bleepsix/issues/77

Tagging as 'wontfix' and closing. If anyone has ideas on a better solution I'm open to the possibility.