Fix touchpad swipe/pinch and mouse wheel scroll behaviour - #74
Conversation
- Two-finger trackpad swipes (precise wheel events) now always freely pan the viewport on both axes, instead of behaving like mouse wheel notches (vertical swipe zooming, horizontal swipe panning). - Pinch gesture zoom stays free/continuous by default; holding Ctrl while pinching now snaps to the nearest integer zoom level. - Regular mouse wheel scrolling is now consistent between the vertical and horizontal axes: both pan by default, or both zoom when Ctrl is held (or vice versa if "Zoom with scroll wheel" is unchecked), instead of vertical wheel zooming while horizontal wheel/shift+wheel panned. - Removed the now-obsolete "Zoom sliding two fingers" preference, since swiping always pans. Fixes #11 Co-authored-by: Daniel Praźmo <Nidrax@users.noreply.github.com>
e08f4ef to
34b3baa
Compare
|
@claude doesn't seem to be working when I test it on my MacBook Pro. |
|
Claude finished @Nidrax's task in 8m 11s —— View job Findings and fix
Root cause: the new pan/zoom logic in This lines up with what LibreSprite#581 independently found and fixed for their SDL2 backend. Changes pushed (
I deliberately did not port LibreSprite#581's unconditional removal of the horizontal-scroll delta negation — that part of their patch touches all platforms without an explained rationale, and flipping it blind risks inverting horizontal wheel scroll on Linux/Windows. If horizontal direction still feels wrong on your Mac after this fix, it's a one-line, well-scoped follow-up. Limitation: I can't build or run Besprited on macOS from this environment (Linux sandbox, no Xcode/macOS SDK, and the system CMake here is too old for this repo's Branch: |
The SDL2 backend (default on all platforms, including macOS) never called setPreciseWheel()/setPointerType(Multitouch) on MouseWheel events, so the trackpad-swipe-always-pans logic added for #11 was dead code everywhere except the legacy native osx backend. It also never emitted TouchMagnify events at all, since SDL2's Cocoa backend does not forward pinch gestures. - she.cpp: detect precise wheel via SDL's preciseX/preciseY (2.0.18+) on non-Apple platforms; always treat wheel input as precise on macOS, since virtually all Mac scroll input is trackpad-originated and pinch is the dedicated zoom gesture. - Add osx/magnify_gesture.mm: swizzles magnifyWithEvent: on SDL's content view to queue TouchMagnify events, mirroring what the native osx backend's view.mm already does, ported from LibreSprite#581. Fixes #11 Co-authored-by: Daniel Praźmo <4753308+Nidrax@users.noreply.github.com>
464d137 to
1904c2b
Compare
Fixes #11
Co-authored-by: Claude noreply@anthropic.com