7 ms·
Having trouble zooming in and out (ctrl + scroll). The zoom is incredibly sensitive and once I've zoomed one way, I can't get back to normal... Only to the pola
by danhardman 11y ago
Having trouble zooming in and out (ctrl + scroll). The zoom is incredibly sensitive and once I've zoomed one way, I can't get back to normal... Only to the polar opposite.
- dwwoelfel 11y agoUse alt+scroll for less sensitive zoom. You can also hit "1" to reset your viewport to the origin with no zoom. It's a bit of an oddity that ctrl + scroll works at all--mac trackpads set the ctrl key bit on the event when you use pinch-to-zoom. At the normal rate, the pinch-to-zoom feels too sluggish, so I speed it up by 10x. Unfortunately, I can't find a way to tell the difference between pinch-to-zoom on a mac trackpad and normal ctrl + scroll.
- moron4hire 11y agoWould something like this work? ontouchstart: scrollMultiplier = 10; ontouchend: if(evt.touches.length === 1) scrollMultiplier = 1;
- dwwoelfel 11y agoI would have thought it would be a touch event, but it's actually a normal scroll event. The only difference I can see is that it has the ctrl bit flipped. Here's the stackoverflow answer: http://stackoverflow.com/questions/15416851/catching-mac-trackpad-zoom http://stackoverflow.com/questions/15416851/catching-mac-tra...
- TheLoneWolfling 11y agoProbably for interoperability for applications that use "standard" ctrl-scroll for zoom. It's a relatively common shortcut.
- moron4hire 11y agoI understand that, but do any of the touch events fire in parallel? Like, just before the pinch happens, is there not a touch start even for when the fingers touch the screen? The idea is to change the rate of the normal scroll event only if there are fingers on the screen.
- dwwoelfel 11y agoI don't think there are any touch events at all when you're using a trackpad on a mac. For mobile, we can distinguish by the touch events.
- moron4hire 11y agoOh, yes, I'm sorry. I completely spaced on what you were saying.