forked from 1b-agent/opencadstudio-upstream
feat(grip): value-prompt actions Lengthen/Radius/Arc Length
Lengthen / Radius / Arc Length need a number after the pick. Stash `grip_pending` on the picked action, push prompt to command line, route next `CommandSubmit` parse into `apply_grip_menu_value`. Escape cancels. - `Grippable::grip_menu_value_prompt` returns label when action wants value; `apply_grip_menu_value` runs the edit. Dispatched via `EntityTypeOps`. - Line: Lengthen extends either endpoint along line direction. - Arc: Radius sets radius; Arc Length redrives end angle from `value / radius`; Lengthen extends start / end angle the same way.
This commit is contained in:
1 parent
86ca1b7033
commit
559cd76369
5 files changed
+243
-5
No files matched your search
@@ -43,6 +43,18 @@ pub struct GripPopup {
|
||||
pub items: Vec<crate::scene::object::GripMenuItem>,
|
||||
pub selected: usize,
|
||||
}
|
||||
|
||||
/// Pending follow-up value for grip-menu actions that need a number
|
||||
/// (Lengthen / Radius / Arc Length / Rotate Text). The next number
|
||||
/// typed in the command line is parsed and routed into
|
||||
/// `apply_grip_menu_value` for `(handle, grip_id, action)`.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct GripPendingValue {
|
||||
pub handle: acadrust::Handle,
|
||||
pub grip_id: usize,
|
||||
pub action: crate::scene::object::GripMenuAction,
|
||||
pub label: &'static str,
|
||||
}
|
||||
use crate::snap::Snapper;
|
||||
use crate::ui::{AppMenu, CommandLine, Ribbon, StatusBar};
|
||||
use acadrust::types::{Color as AcadColor, LineWeight};
|
||||
@@ -122,6 +134,7 @@ pub(super) struct OpenCADStudio {
|
||||
/// Open multi-functional grip popup. Persists across mouse moves
|
||||
/// until dismissed (click outside, ESC, cursor leaves the grip).
|
||||
grip_popup: Option<GripPopup>,
|
||||
grip_pending: Option<GripPendingValue>,
|
||||
/// Show the UCS icon in the bottom-left corner of model space (UCSICON).
|
||||
show_ucs_icon: bool,
|
||||
/// Whether the ViewCube 3D gizmo is visible in model space (NAVVCUBE).
|
||||
@@ -806,6 +819,7 @@ impl OpenCADStudio {
|
||||
dyn_user_reshaped: false,
|
||||
grip_hover: None,
|
||||
grip_popup: None,
|
||||
grip_pending: None,
|
||||
show_ucs_icon: true,
|
||||
show_viewcube: true,
|
||||
show_properties: true,
|
||||
|
||||
Reference in new issue
Block a user