feat(pick): select frame-like entities by clicking inside them

Images, OLE frames, wipeouts, underlays, paper-space viewports and
drawing-view borders were selectable only on their outline. Each now
carries an interior pick surface (pick_tris over its rectangle, or the
triangulated clip polygon for a clipped underlay), ranked below edge
and fill hits so content drawn inside still wins the click. The
layout's own sheet ("overall") viewport is excluded — identified by
the Layout object's viewport link, since DWG files carry viewport
id = 0 and some center the sheet viewport off-origin — or it would
swallow every click over the real viewports beneath it. Drawing-view
borders draw nothing normally; they emit an invisible pick-only wire
whose rect outline appears while selected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-21 09:28:07 +03:00
commit e1a4ddef5e
6 changed files with 116 additions and 10 deletions

View file

@ -52,8 +52,12 @@ impl TruckConvertible for Underlay {
}
// Insertion grip.
let key: Vec<[f64; 3]> = pts.clone();
// Interior pick surface over the clip polygon so the underlay
// selects on a click anywhere inside, not just on its outline.
let ring: Vec<[f64; 3]> = world_verts.iter().map(|v| [v.x, v.y, v.z]).collect();
let pick_tris = crate::entities::mesh::triangulate_planar(&ring);
Some(TruckEntity {
pick_tris: Vec::new(),
pick_tris,
object: TruckObject::Lines(pts),
snap_pts: vec![(glam::DVec3::new(self.insertion_point.x, self.insertion_point.y, self.insertion_point.z), SnapHint::Node)],
tangent_geoms: vec![],