diff --git a/system/public/aesthetic.computer/disks/cap.mjs b/system/public/aesthetic.computer/disks/cap.mjs index cb2a7891b9..e533b9266c 100644 --- a/system/public/aesthetic.computer/disks/cap.mjs +++ b/system/public/aesthetic.computer/disks/cap.mjs @@ -50,17 +50,14 @@ let pendingRecordStart = false; // Track if user wants to record but mic isn't r // `zoom` scales the camera frame around the screen center. 1 = no zoom. // `zoomStartY` is the Y position of the touch that began recording. // `zoomMax` caps how far the user can zoom in via slide. -// A short upward slide zooms quickly; recent finger velocity projects the -// gesture forward so fast throws feel more extreme than slow positioning. +// A short upward slide zooms quickly. Zoom follows absolute finger position +// instead of touch-event velocity so irregular mobile event timing cannot +// make the camera scale jump ahead and snap back. let zoom = 1; let zoomStartY = null; -let zoomLastY = null; -let zoomLastAt = 0; -let zoomVelocity = 0; const zoomMax = 6; const zoomMin = 1; const zoomSensitivity = 120; -const zoomInertiaMs = 180; // 🥾 Boot function boot({ ui, params, colon, system, rec, notice }) { @@ -83,9 +80,6 @@ function boot({ ui, params, colon, system, rec, notice }) { torchPending = false; zoom = 1; zoomStartY = null; - zoomLastY = null; - zoomLastAt = 0; - zoomVelocity = 0; // Parse parameters if (params[0] === "me" || params[0] === "selfie") facing = "user"; @@ -453,9 +447,6 @@ function act({ event: e, jump, video, cameras, rec, notice, leaving, hud }) { // Anchor zoom slider at the touch-down Y so the very first drag // pixel is treated as zoom = 1, no jumps. zoomStartY = e.y; - zoomLastY = e.y; - zoomLastAt = performance.now(); - zoomVelocity = 0; startRecording(rec, notice); } } @@ -465,16 +456,9 @@ function act({ event: e, jump, video, cameras, rec, notice, leaving, hud }) { // Y delta each draw event — this means the user can swing freely // up and down without accumulating drift across pauses. if (e.is("draw") && isRecording && zoomStartY !== null) { - const now = performance.now(); - const dt = Math.max(1, now - zoomLastAt); - const instantVelocity = (zoomLastY - e.y) / dt; - zoomVelocity += (instantVelocity - zoomVelocity) * 0.55; const dy = zoomStartY - e.y; // up is positive - const projectedDy = dy + zoomVelocity * zoomInertiaMs; - const target = 1 + projectedDy / zoomSensitivity; + const target = 1 + dy / zoomSensitivity; zoom = Math.max(zoomMin, Math.min(zoomMax, target)); - zoomLastY = e.y; - zoomLastAt = now; } if (e.is("lift") && !leaving()) { @@ -486,9 +470,6 @@ function act({ event: e, jump, video, cameras, rec, notice, leaving, hud }) { notice("CANCELLED", ["yellow", "black"]); } zoomStartY = null; - zoomLastY = null; - zoomLastAt = 0; - zoomVelocity = 0; zoom = 1; }