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:
parent
84adb71cee
commit
e1a4ddef5e
6 changed files with 116 additions and 10 deletions
|
|
@ -43,7 +43,14 @@ fn to_truck(ole: &Ole2Frame) -> TruckEntity {
|
|||
];
|
||||
let center = glam::DVec3::new(cx, cy, z);
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
// Interior pick surface: the frame selects on a click anywhere
|
||||
// inside, not just on its border.
|
||||
pick_tris: crate::entities::common::quad_pick_tris(&[
|
||||
[x0, y0, z],
|
||||
[x1, y0, z],
|
||||
[x1, y1, z],
|
||||
[x0, y1, z],
|
||||
]),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(center, SnapHint::Center)],
|
||||
tangent_geoms: vec![],
|
||||
|
|
|
|||
Loading…
Reference in a new issue