feat(zoom): add fScrollPan and fPinchStep inputs to FZoomDirective#313
Conversation
…croll-pan PR #313 by @yaroslavyushchenko independently implemented scroll-pan and fPinchStep against the pre-v19 zoom directive. It is merged to main so the contribution stays in history; this merge resolves every touched file to the v19 implementation, which covers the same behavior through the control scheme with deltaMode-normalized pan deltas and the mediator scroll path. Credited in the changelog. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Merged - thank you for this one 🙌 Quick heads-up so the follow-up doesn't surprise you: while this PR was sitting in the queue, the v19 branch (#314) grew a control-scheme feature that ended up covering the same ground - So in the v19 merge your implementation gets unified into the scheme-driven one - the behavior survives, the code path changes:
You're credited in the v19 changelog for proposing both features. If the per-instance Appreciate the tests and the clean scope of this PR - if you feel like picking up something else in v19, PRs are always welcome. |
Summary
fScrollPan: boolean— when enabled, two-finger scroll on a trackpad pans the canvas instead of zooming. Opt-in, defaultfalse.fPinchStep: number— separate zoom step for pinch gestures. When0, falls back tofZoomStep. Default0.Related Issue
Closes #312
Problem
On MacBook and other precision trackpads, two-finger scroll triggers zoom instead of panning the canvas. There was also no way to tune pinch-to-zoom speed independently from mouse wheel zoom — both shared
fZoomStep, but pinch gestures have very different sensitivity.Scope
libs/f-flow/src/f-zoom/f-zoom.directive.ts— two new inputs, wheel routing logiclibs/f-flow/src/f-zoom/wheel-zoom.utils.ts— newisTrackpadScrollEventutilitylibs/f-flow/src/f-zoom/wheel-zoom.utils.spec.ts— unit testslibs/f-examples/extensions/zoom/— checkbox added to the live exampleapps/f-flow-portal/public/— docs updatedPublic API Impact
Two new opt-in inputs on
FZoomDirective. No breaking changes. Default behavior is unchanged.fScrollPanbooleanfalsefPinchStepnumber0Documentation and Examples
f-zoom-directive.md— new inputs documentedllms-full.txtandllms.txt— updatedTesting
All 140 existing tests pass. New unit test added for
isTrackpadScrollEventcovering pixel-mode detection and modifier key exclusions.