fix(grips): prevent phantom snapping

Keep hidden pre-drag geometry out of snap candidates and avoid empty
scene invalidations. Require stable OTRACK dwell observations and cache
planar-solid visibility during live previews.

Refs #930
This commit is contained in:
Hakan Seven committed 2026-08-30 22:26:47 +03:00
1 parent 2a482089b8
commit 853e830126
6 files changed
+56 -61

No files matched your search

+3
View File
@@ -314,6 +314,8 @@ pub struct Pipeline {
pub cached_selection: (u64, u64),
/// Face upload key; keeps the resident wire Arc uniquely owned by Scene.
pub cached_face3d_key: (u64, bool, bool, u64),
/// Cached planar-solid visibility for `(wire_content_id, view direction)`.
pub cached_solid_visibility: (u64, [u32; 3], u64),
/// Handle → indices into the resident wire set, built once per wire upload
/// (when `cached_wire_id` changes). Lets the selection/hover xray overlay
/// gather just the highlighted entity's wires (`O(highlighted)`) instead of
@@ -2320,6 +2322,7 @@ impl Pipeline {
cached_wire_id: u64::MAX,
cached_selection: (u64::MAX, u64::MAX),
cached_face3d_key: (u64::MAX, false, false, u64::MAX),
cached_solid_visibility: (u64::MAX, [u32::MAX; 3], u64::MAX),
wire_handle_index: std::sync::Arc::new(rustc_hash::FxHashMap::default()),
render_sig: u64::MAX,
skip_geometry: false,
+18 -2
View File
@@ -381,6 +381,8 @@ impl shader::Primitive for Primitive {
inner.cached_selection = (u64::MAX, u64::MAX);
inner.cached_mesh_content_id = u64::MAX;
inner.cached_face3d_key = (u64::MAX, false, false, u64::MAX);
inner.cached_solid_visibility =
(u64::MAX, [u32::MAX; 3], u64::MAX);
inner.cached_hatch_source = None;
inner.cached_preview_hatch_source = None;
inner.cached_wipeout_source = None;
@@ -487,11 +489,25 @@ impl shader::Primitive for Primitive {
// the Wireframe overlay style.
let face3d_fill_active = fill_mode && !vp.view_wireframe;
let solid_fill_active = fill_mode && vp.show_2d_solid_fills;
let solid_visibility_key =
let view_dir_key = [
vp.view_dir.x.to_bits(),
vp.view_dir.y.to_bits(),
vp.view_dir.z.to_bits(),
];
let solid_visibility_key = if !solid_fill_active {
0
} else if inner.cached_solid_visibility.0 == vp.wire_content_id
&& inner.cached_solid_visibility.1 == view_dir_key
{
inner.cached_solid_visibility.2
} else {
crate::scene::pipeline::face3d_gpu::planar_solid_visibility_key(
&vp_wires,
vp.view_dir,
);
)
};
inner.cached_solid_visibility =
(vp.wire_content_id, view_dir_key, solid_visibility_key);
let fill_changed = inner.cached_fill_mode != fill_mode;
let hatch_changed = inner
.cached_hatch_source