forked from 1b-agent/opencadstudio-upstream
fix(osnap): a POINT snaps as a Node only
A point carried a key vertex, so Endpoint (which outranks Node) claimed it, and an absolute-size glyph's strokes were indexed for Nearest and Intersection. Points now offer only their Node, in the indexed and the unindexed snap paths alike. Fixes #1570 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d6dfd0d46d
commit
fd01a36ad3
4 files changed
+28
-8
No files matched your search
@@ -744,6 +744,11 @@ impl WireModel {
|
||||
pub fn is_display_only(&self) -> bool {
|
||||
self.snap_only && self.display_visible
|
||||
}
|
||||
/// A POINT's wire: the Node is its only snap; the glyph strokes are drawn
|
||||
/// but offer no endpoints or segments to snap to.
|
||||
pub fn is_node_marker(&self) -> bool {
|
||||
self.key_vertices.is_empty() && matches!(self.snap_pts.as_slice(), [(_, SnapHint::Node)])
|
||||
}
|
||||
/// Sentinel AABB that never rejects any snap query.
|
||||
pub const UNBOUNDED_AABB: [f32; 4] = [
|
||||
f32::NEG_INFINITY,
|
||||
|
||||
@@ -699,7 +699,7 @@ fn append_wire_index_entries(wire_idx: u32, wire: &WireModel, batch: &mut WireIn
|
||||
);
|
||||
}
|
||||
|
||||
if wire.point_marker.is_none() {
|
||||
if wire.point_marker.is_none() && !wire.is_node_marker() {
|
||||
for start in 0..wire.points.len().saturating_sub(1) {
|
||||
let Some(aabb) = points_aabb3([
|
||||
wire_point(wire, start),
|
||||
|
||||
Reference in new issue
Block a user