Skip to content

Commit 37310e4

Browse files
committed
feat: Adjust zoom momentum parameters for smoother pinch glide interactions
1 parent 252b88e commit 37310e4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/NodeCanvas.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ const GLIDE_FRICTION_MAX = 0.985; // clamp ceiling for glide frict
177177
// direction, anchored to the last pinch midpoint. Velocity is tracked in
178178
// log-zoom space (d(ln zoom)/dt) so it decays multiplicatively like the pinch
179179
// itself. Kept deliberately "slight": low boost + heavy friction = a short tail.
180-
const ZOOM_MOMENTUM_BOOST = 1.0; // scales the release velocity into the glide (1 = launch at measured finger speed)
180+
const ZOOM_MOMENTUM_BOOST = 0.8; // scales the release velocity into the glide (<1 = coast launches gentler than the fingers)
181181
const ZOOM_MOMENTUM_FRICTION = 0.86; // per-frame retention of zoom velocity for gentle releases (short coast)
182182
const ZOOM_MOMENTUM_FRICTION_HIGH_VELOCITY = 0.91; // retention for violent flicks — same fast-flick ramp idea as TOUCH_PAN_FRICTION_HIGH_VELOCITY
183183
const ZOOM_HIGH_VELOCITY_THRESHOLD = 0.003; // |d(ln zoom)/dt| above which the high-velocity friction starts ramping in
184184
const ZOOM_HIGH_VELOCITY_RAMP = 0.005; // velocity range over which friction lerps from base to high
185-
const ZOOM_MOMENTUM_MIN_SPEED = 0.00025; // |d(ln zoom)/dt| threshold to launch and to stop the glide
186-
const ZOOM_MOMENTUM_MAX_SPEED = 0.012; // cap on launch velocity so a fast pinch can't fling the zoom
185+
const ZOOM_MOMENTUM_MIN_SPEED = 0.0004; // |d(ln zoom)/dt| threshold to launch and to stop the glide (deliberate slow releases stay put)
186+
const ZOOM_MOMENTUM_MAX_SPEED = 0.009; // cap on launch velocity so a fast pinch can't fling the zoom
187187
const PINCH_GLIDE_STRENGTH_VEL_RANGE = 0.8; // velocity multiplier sweep for the strength slider: 0.6× at 0 → 1.4× at 1 (0.5 = 1×)
188188
const PINCH_GLIDE_STRENGTH_FRICTION_RANGE = 0.08; // friction offset sweep for the strength slider (±0.04 around default)
189189

0 commit comments

Comments
 (0)