forked from 1b-agent/opencadstudio-upstream
feat(viewport): tile-relative input + overlays in unified model
Route every per-frame interaction through the active model tile's screen rectangle so a tiled VPORTS layout behaves like independent panes while still sharing one shader widget: - pick / draw / snap / box+lasso: cursor mapped to tile-local space; the hover-activates-tile rule on ViewportMove keeps the active tile under the cursor, so the picked camera matches what the user sees. - pan: switched to Camera::pan_screen(dx, dy, viewport_height) so the world-per-pixel rate matches the active tile's height instead of the full canvas. - grid: clipped via Frame::with_clip to the active tile rect; world→screen adds the tile origin so the lines align with the panel. - UCS icon: origin offset by the tile rect so the gizmo sits in the active tile's bottom-left corner. - render-mode picker (+ split buttons) and ViewCube hit-area: positioned via active_model_tile_bounds with leading Spaces, mirroring the floating-viewport pattern. - ViewCube hover: driven by the CursorMoved/ViewportMove handlers into a new Scene::viewcube_hover cell, so the highlight survives the cube hit-area overlay masking events from shader::Program::update. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
6fe25e4b5f
commit
417a708275
7 files changed
+330
-86
No files matched your search
+2
-2
@@ -42,8 +42,8 @@ pub fn grips_to_screen(
|
||||
.map(|g| {
|
||||
let ndc = view_proj.project_point3(g.world);
|
||||
let screen = Point::new(
|
||||
(ndc.x + 1.0) * 0.5 * bounds.width,
|
||||
(1.0 - ndc.y) * 0.5 * bounds.height,
|
||||
bounds.x + (ndc.x + 1.0) * 0.5 * bounds.width,
|
||||
bounds.y + (1.0 - ndc.y) * 0.5 * bounds.height,
|
||||
);
|
||||
(g.id, screen, g.is_midpoint, g.shape)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user