fix(ucs): snap ViewCube face views square to the active UCS

Clicking a ViewCube face rotated the gaze into the UCS frame but derived
the up vector from world X/Y/Z, so the snapped view landed world-aligned
(most visibly Top, where the UCS shares world Z and only the in-plane
roll differs). snap_to_direction now takes the UCS basis and picks its up
from the UCS axes, so a face snap lands square to the user's coordinate
system. Identity UCS reproduces the world-aligned snap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-22 11:12:43 +03:00
commit 98142ee4af
2 changed files with 13 additions and 14 deletions

View file

@ -4351,7 +4351,7 @@ impl OpenCADStudio {
.snap_active_viewport_to_direction(eye_dir);
} else {
let mut cam = self.tabs[i].scene.camera.borrow_mut();
cam.snap_to_direction(eye_dir);
cam.snap_to_direction(eye_dir, r_ucs);
}
self.tabs[i].scene.camera_generation += 1;
self.command_line