native
native copied to clipboard
First-class trackpad pinch input for GPU-surface apps
Fixes the reported gap: AppKit received magnify gestures but the GPU-surface event API dropped them before applications could respond — timeline and canvas apps had no pinch input at all.
- Platform-neutral vocabulary:
pinch_begin/pinch_change/pinch_endjoinGpuSurfaceInputKind, with ascale: f32field carrying the per-change magnification delta (cumulative zoom = product of1+delta; deltas emit uncoalesced because summed coalesced deltas would drift the product) and the centroid on the existing x/y. The kind family stays open for rotate/smart-zoom; Windows precision-touchpad and GTK GestureZoom are staged honestly as follow-up sources (nothing panics — the kinds simply never arrive there yet). - macOS host:
magnifyWithEvent:translates phases (Cancelled folds intopinch_end— unlike pointer-cancel there is no uncommitted transient to roll back; a Changed with no active gesture opens with a synthesized begin). - Delivery is an app-level channel, matching the frame/key pattern: Zig cores get
Options.on_pinch; TypeScript cores exportpinchMsg(pinch): Msg | null. Zoom is an app concern — pinch deliberately bypasses the widget pipeline, and no registry codes were consumed. One transpiler fix rode along: the pinch record's fields are classed as boundary floats soscale === 0comparisons can't int-claim the slot and round zoom products. widget-pinchautomation verb (begin + one exact-product change + end, journaled as real input) so tests and users drive pinch without a trackpad; journal v5 carries the scale field and automation protocol v7 the verb — both stated as deliberate breaks in the changelog.- Record→replay pins binary-exact zoom products (1.25² = 1.5625) for raw and verb-driven pinches in both tiers; every behavior test sabotage-verified.
Suites: full battery, validate, tooling, examples, ts-core e2e, docs check, packages/core npm suite (210/210) — all green.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| native-sdk | Preview, Comment | Jul 17, 2026 5:12pm |
@ctate thanks for getting this merged in! I've got a neat little video editor I've been porting from WebCodecs + WebGPU to fully native on MacOS w/ Metal and this was another thing I needed.