feat(properties): navigate polyline vertices from the panel

The Current Vertex row is now a ◀ / ▶ stepper (new PropValue::Stepper)
showing "i / N". Stepping it moves the panel's focus through the
polyline's vertices — Vertex X/Y and the per-vertex start/end widths show
and edit the focused vertex instead of always the first — and the focused
vertex's grip is drawn hot (filled) in the drawing so it's visible while
navigating. Focus wraps around and resets to the first vertex when the
selection changes. Adds Area and Length to the LwPolyline Geometry group
(Polyline2D already had them). Applies to LwPolyline and Polyline2D.

The focused vertex is threaded to the per-entity property builder/editor
through a dispatch thread-local (like the curve-tolerance override), so
the PropertyEditable trait signatures are unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-08 17:53:05 +03:00
1 parent a4f7ee376f
commit b3c8c0a2f1
12 files changed
+208 -22

No files matched your search

+14 -1
View File
@@ -219,6 +219,18 @@ impl OpenCADStudio {
None => tab.scene.active_model_tile_bounds(vw, vh),
};
let sel_h = tab.selected_handle;
// The Current Vertex the Properties panel is focused on:
// mark that grip hot so the navigated vertex is visible in
// the drawing. Only for a single selected polyline, whose
// vertex grips are ids 0..n. (Properties vertex stepper)
let current_vertex_grip: Option<usize> = sel_h.and_then(|h| {
matches!(
tab.scene.document.get_entity(h),
Some(acadrust::EntityType::LwPolyline(_))
| Some(acadrust::EntityType::Polyline2D(_))
)
.then_some(tab.properties.prop_vertex)
});
// In-viewport grips are model-space; project them with the
// viewport camera so they sit on the wire the GPU draws.
// Paper entities use the 2-D paper transform; the model tab
@@ -257,7 +269,8 @@ impl OpenCADStudio {
let is_hot = tab
.active_grip
.as_ref()
.map_or(false, |g| Some(g.handle) == sel_h && g.grip_id == grip_id);
.map_or(false, |g| Some(g.handle) == sel_h && g.grip_id == grip_id)
|| Some(grip_id) == current_vertex_grip;
crate::ui::overlay::GripMarker {
pos: screen,
shape,