forked from 1b-agent/opencadstudio-upstream
CLIP: Enter at the object prompt ends silently
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b1d4c9bd9b
commit
d217248ac3
3 files changed
+7
-3
No files matched your search
@@ -1295,7 +1295,9 @@ impl OpenCADStudio {
|
|||||||
self.tabs[i].snap_result = None;
|
self.tabs[i].snap_result = None;
|
||||||
self.tabs[i].scene.clear_preview_wire();
|
self.tabs[i].scene.clear_preview_wire();
|
||||||
self.restore_pre_cmd_tangent();
|
self.restore_pre_cmd_tangent();
|
||||||
self.command_line.push_output(&msg);
|
if !msg.is_empty() {
|
||||||
|
self.command_line.push_output(&msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_report_measurement(&mut self, msg: String) {
|
fn handle_report_measurement(&mut self, msg: String) {
|
||||||
|
|||||||
+2
-1
@@ -1943,7 +1943,8 @@ pub enum CmdResult {
|
|||||||
p1: DVec3,
|
p1: DVec3,
|
||||||
p2: DVec3,
|
p2: DVec3,
|
||||||
},
|
},
|
||||||
/// Print a measurement result to the command line and end the command.
|
/// Print a measurement result to the command line and end the command
|
||||||
|
/// (an empty one ends it silently).
|
||||||
Measurement(String),
|
Measurement(String),
|
||||||
/// Print a measurement result and keep the command active.
|
/// Print a measurement result and keep the command active.
|
||||||
ReportMeasurement(String),
|
ReportMeasurement(String),
|
||||||
|
|||||||
@@ -550,9 +550,10 @@ impl CadCommand for ClipCommand {
|
|||||||
self.inner.as_mut().and_then(|c| c.on_text_input(text))
|
self.inner.as_mut().and_then(|c| c.on_text_input(text))
|
||||||
}
|
}
|
||||||
fn on_enter(&mut self) -> CmdResult {
|
fn on_enter(&mut self) -> CmdResult {
|
||||||
|
// Enter before an object is picked ends CLIP without a message.
|
||||||
self.inner
|
self.inner
|
||||||
.as_mut()
|
.as_mut()
|
||||||
.map_or(CmdResult::Cancel, |c| c.on_enter())
|
.map_or(CmdResult::Measurement(String::new()), |c| c.on_enter())
|
||||||
}
|
}
|
||||||
fn on_mouse_move(&mut self, pt: DVec3) -> Option<WireModel> {
|
fn on_mouse_move(&mut self, pt: DVec3) -> Option<WireModel> {
|
||||||
self.inner.as_mut().and_then(|c| c.on_mouse_move(pt))
|
self.inner.as_mut().and_then(|c| c.on_mouse_move(pt))
|
||||||
|
|||||||
Reference in new issue
Block a user