forked from 1b-agent/opencadstudio-upstream
feat(grip): complete standard grip-shape vocabulary
Existing entity grip definitions already followed the conventional CAD layout: square at vertices / endpoints, diamond at curve centres / midpoints, triangle for directional control. Round out the supported shape vocabulary with the two missing standards so future entities (polyline straight-segment stretch grips, dimension parameter grips, …) can pick the right marker without inventing ad-hoc visuals: - `GripShape::Rectangle` — direction-aware mid-segment stretch handle (wider-than-tall box). - `GripShape::Circle` — parametric control (radius / dimension value). New `rectangle_grip` / `circle_grip` helpers in `entities::common` mirror the existing `square_grip` / `diamond_grip` / `triangle_grip` constructors. `SelectionCanvas::draw` renders the two new variants; the previously-used Square / Diamond / Triangle paths are unchanged. Both new variants carry `#[allow(dead_code)]` until an entity adopts them.
This commit is contained in:
1 parent
0ec6d77cb1
commit
1e33a9049c
3 files changed
+43
-1
No files matched your search
+12
-1
@@ -51,12 +51,23 @@ pub struct PropSection {
|
||||
|
||||
// ── Grip types ─────────────────────────────────────────────────────────────
|
||||
|
||||
/// Describes one grip point for an entity.
|
||||
/// Visual marker shape for a grip point. The complete vocabulary used
|
||||
/// across entity types:
|
||||
/// * `Square` — vertex / endpoint that moves a single point.
|
||||
/// * `Rectangle` — direction-aware mid-segment stretch (polyline
|
||||
/// straight segments, dimension extension lines).
|
||||
/// * `Diamond` — midpoint of a curve / centre of a closed shape (drags
|
||||
/// the whole shape or stretches the midpoint).
|
||||
/// * `Triangle` — directional control (rotate / add vertex / continue).
|
||||
/// * `Circle` — parametric control (radius / dimension value).
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[allow(dead_code)]
|
||||
pub enum GripShape {
|
||||
Square,
|
||||
Rectangle,
|
||||
Diamond,
|
||||
Triangle,
|
||||
Circle,
|
||||
}
|
||||
|
||||
/// Describes one grip point for an entity.
|
||||
|
||||
Reference in new issue
Block a user