forked from 1b-agent/opencadstudio-upstream
feat(draw): continue paths on initial Enter
Start LINE, PLINE, ARC, and SPLINE from the latest path endpoint when Enter accepts the first point. Fall back to the active UCS origin.\n\nRefs #610
This commit is contained in:
1 parent
796d7d91d0
commit
dccaf95f49
10 files changed
+175
-12
No files matched your search
@@ -369,6 +369,9 @@ impl CadCommand for ArcCommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -467,6 +470,9 @@ impl CadCommand for Arc3PCommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.pts.is_empty()
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -564,6 +570,9 @@ impl CadCommand for ArcSCECommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -664,6 +673,9 @@ impl CadCommand for ArcSCACommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -787,6 +799,9 @@ impl CadCommand for ArcSCLCommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -886,6 +901,9 @@ impl CadCommand for ArcSEACommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -961,6 +979,9 @@ impl CadCommand for ArcSERCommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -1074,6 +1095,9 @@ impl CadCommand for ArcSEDCommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -1160,6 +1184,9 @@ impl CadCommand for ArcCSACommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
@@ -1279,6 +1306,9 @@ impl CadCommand for ArcCSLCommand {
|
||||
fn on_enter(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.step == 0
|
||||
}
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
@@ -150,6 +150,10 @@ impl CadCommand for LineCommand {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.points.is_empty()
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
CmdResult::Cancel
|
||||
}
|
||||
|
||||
@@ -355,6 +355,10 @@ impl CadCommand for PlineCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.vertices.is_empty()
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
match self.live_handle {
|
||||
Some(handle) => CmdResult::FinalizeLiveEntity(handle),
|
||||
|
||||
@@ -143,6 +143,10 @@ impl CadCommand for SplineCommand {
|
||||
}
|
||||
}
|
||||
|
||||
fn enter_accepts_default_start(&self) -> bool {
|
||||
self.pts.is_empty()
|
||||
}
|
||||
|
||||
fn on_escape(&mut self) -> CmdResult {
|
||||
match self.build(false) {
|
||||
Some(e) => CmdResult::CommitAndExit(e),
|
||||
|
||||
Reference in new issue
Block a user