From 6792c7265cdca8b636b2f034ecff4d0516386b30 Mon Sep 17 00:00:00 2001 From: gianlucafiore <50465150+gianlucafiore@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:16:45 -0300 Subject: [PATCH] fix(visual): anchor Extension at the acquired world endpoint projection --- src/app/view/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/app/view/mod.rs b/src/app/view/mod.rs index 71a09aa82..4588fad6e 100644 --- a/src/app/view/mod.rs +++ b/src/app/view/mod.rs @@ -941,6 +941,21 @@ bg={bg_ms:.1}ms n={view_count}" } None }; + // Draw the Extension start at the actual acquired *world* point, + // projected through the same camera/rect as the entity and guides. + // The snap engine's screen-space base is only pane-local and can + // differ from the final canvas coordinates used by the overlay. + // Keep that older value as a fallback for snaps without origin. + let snap_ext_base = tab + .snap_result + .filter(|hit| hit.snap_type == crate::snap::SnapType::Extension) + .and_then(|hit| hit.extension_origin) + .and_then(|origin| { + let (rot, eye, rect) = otrack_proj?; + let pixel = ost_project(origin, rot, eye, rect); + (pixel.x.is_finite() && pixel.y.is_finite()).then_some(pixel) + }) + .or(snap_ext_base); // OSNAP Extension is also active with F11 / OTRACK turned off. // Give its marker the actual acquired geometric direction instead // of reconstructing a new ray from the moving snap cursor.