forked from 1b-agent/opencadstudio-upstream
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:
1 parent
84adb71cee
commit
e1a4ddef5e
6 files changed
+116
-10
No files matched your search
@@ -119,6 +119,13 @@ pub fn format_angle(value_rad: f64) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
/// Two interior triangles covering a quad (flat list, 6 vertices) — the
|
||||
/// click-anywhere pick surface for frame-like entities (image, OLE frame,
|
||||
/// underlay, wipeout). Corners in ring order.
|
||||
pub fn quad_pick_tris(c: &[[f64; 3]; 4]) -> Vec<[f64; 3]> {
|
||||
vec![c[0], c[1], c[2], c[0], c[2], c[3]]
|
||||
}
|
||||
|
||||
pub fn square_grip(id: usize, world: glam::DVec3) -> GripDef {
|
||||
GripDef {
|
||||
id,
|
||||
|
||||
Reference in new issue
Block a user