From 604d1eeae39fc14ea27941d137390ef75e04e6a6 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 10 Jul 2026 21:55:57 -0700 Subject: [PATCH] Add canvas-wheel camera zoom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Give the Bevy canvas a direct mouse and trackpad zoom path while preserving independent right-rail scrolling and shared framing across both render modes. Defense: wiki/interface/bevy-digital-real-canvas.md#camera-and-depth-contract keeps camera movement frontend-only and anchored to the shared canvas. ๐Ÿ‘พ Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code --- README.md | 4 +- crates/misaligned-bevy/src/main.rs | 122 ++++++++++++++++++--- wiki/interface/action-vocabulary.md | 2 +- wiki/interface/bevy-digital-real-canvas.md | 5 + wiki/interface/bevy.md | 22 ++-- wiki/log/2026-07-10-bevy-canvas-zoom.md | 31 ++++++ wiki/log/DEVLOG.md | 5 + 7 files changed, 161 insertions(+), 30 deletions(-) create mode 100644 wiki/log/2026-07-10-bevy-canvas-zoom.md diff --git a/README.md b/README.md index 260d37c9..c757a405 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,8 @@ retired words are inventoried in | `Esc` | Clear selection (or close menu / dial when open) | | In menu: `j`/`k` or numbers, `Enter`, `ESC` | Select a row / execute it / close the menu | | `;` | Focus the most recent anchored (`ยป`) log event โ€” cursor jumps there, menu opens; repeat to walk older ones (terminal; in Bevy click a `>` trace row) | -| `[` / `]` | Zoom (Bevy) | -| Mouse wheel over right pane / `PageUp` / `PageDown` / `Home` / `End` | Scroll Bevy sidebar | +| `[` / `]` or mouse/trackpad wheel over the canvas | Zoom in / out (Bevy) | +| Mouse/trackpad wheel over right pane / `PageUp` / `PageDown` / `Home` / `End` | Scroll Bevy sidebar | | `F3` | Flip Bevy render: material (HD-2D, default) / flat sensorium | | `F4` | Dev work light: flood the material render flat and neutral (inspection only) | | `Ctrl+S` / `Ctrl+L` | Save / load | diff --git a/crates/misaligned-bevy/src/main.rs b/crates/misaligned-bevy/src/main.rs index 40455f0d..c63d77e6 100644 --- a/crates/misaligned-bevy/src/main.rs +++ b/crates/misaligned-bevy/src/main.rs @@ -82,8 +82,14 @@ const CLOSE_DIST: f32 = 2.6; /// Zoom multipliers around the close default (material-dark-frame.md /// criterion 5): min stays a tight rack close-up, max can still survey /// lit pools without the plan driving the frame. [TUNE]. +const ZOOM_STEP: f32 = 0.8; const MIN_ZOOM: f32 = 0.5; const MAX_ZOOM: f32 = 6.0; +const MIN_FLAT_ZOOM: f32 = 0.25; +const MAX_FLAT_ZOOM: f32 = 1.5; +/// A pixel-scrolling trackpad needs a travel distance rather than treating +/// every sub-pixel update as a full discrete wheel notch. [TUNE]. +const WHEEL_PIXELS_PER_ZOOM_STEP: f32 = 120.0; /// The dark rig's near-nothing ambient brightness (material-dark-frame.md: /// a physically dark room before Eyes โ€” nobody is home, the AI does not need /// lights). A live sight feed replaces this with camera exposure. [TUNE]. @@ -3578,10 +3584,14 @@ const WAKE_LEN: f32 = 6.2; /// rest is dark). Fit-to-known-content is retired as this camera's framing /// driver: the known extent is a plan fact, and the plan no longer drives /// the camera (that fit-to-content default now governs the flat sensorium -/// only). Zoomable with [ ]. The wake sequence hands off to this frame. +/// only). Zoomable with [ ] or the canvas wheel. The wake sequence hands off +/// to this frame. +#[allow(clippy::too_many_arguments)] // ECS camera/input resources are distinct. fn update_camera_real( time: Res