viewer: a trackpad's sideways scroll leaves the camera speed alone (old #6256) #237
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/237"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by ddddddddwp on 2026-11-24T02:51:02Z.
Old issue: #6256 (claim in #14).
What
The free camera's wheel handler took every
wheelevent:A trackpad's two-finger sideways scroll is a
deltaX-only event withdeltaY == 0, so it hit thedeltaY >= 0branch and divided the camera speed by 1.15 per event: panning sideways slowed the camera down.The handler now ignores an event whose horizontal component is larger than its vertical one (and an event with
no
deltaY), so a pan leaves the speed alone. A mostly vertical wheel, including a diagonal one, still changesit by 1.15 per notch.
Test
tests/test_viewer_streaming.cjsalready loads the viewer module in a VM and captures itswheelhandler; theShift/Ctrl camera test now drives it and measures Climb per 0.1 s frame at 40 m/s:
deltaX 120,deltaY 0) keeps 4 m, and the other direction too;deltaX 120,deltaY 10) keeps 4 m;deltaY -100) gives 4.6 m, and one notch down brings it back to 4 m.With the old handler the first sideways event takes the speed to 40 / 1.15 = 34.8 m/s, so the test fails with
3.4782608695652173 is not 4.Run:
node --test tests/test_viewer_streaming.cjs- 57/57 pass;node --test tests/test_viewer_studio.cjs-11/11 pass. Node 22.23 on macOS arm64. No game files, no GPU, nothing online.
AI-assisted.