diff --git a/crates/cad/src/dwg.rs b/crates/cad/src/dwg.rs index 4b9cf7f902..babf160149 100644 --- a/crates/cad/src/dwg.rs +++ b/crates/cad/src/dwg.rs @@ -245,9 +245,11 @@ fn convert(bytes: &[u8]) -> Result { Ok(Converted { dxf, notes: notes.iter().map(|n| worded(n)).collect() }) } -/// Can a DWG file of `version` be written? craft-dwg writes 2000, 2004, 2007, 2010, 2013 and 2018. +/// Can a DWG file of `version` be written? DWG export writes 2000, 2004, 2007, 2010, 2013 and 2018. craft-dwg also +/// writes R13 and R14, which DWG export does not offer yet. pub fn writes(version: crate::DxfVersion) -> bool { - craft_dwg::VERSIONS.iter().any(|(code, _)| *code == version.acadver()) + !matches!(version, crate::DxfVersion::R12 | crate::DxfVersion::R13 | crate::DxfVersion::R14) + && craft_dwg::VERSIONS.iter().any(|(code, _)| *code == version.acadver()) } /// A DWG file of `version` from `dxf`, an ASCII DXF of that version as [`crate::export_drawings`] diff --git a/crates/ui-egui/src/panels/tests_blend.rs b/crates/ui-egui/src/panels/tests_blend.rs index 936d6355a2..b43eb606ad 100644 --- a/crates/ui-egui/src/panels/tests_blend.rs +++ b/crates/ui-egui/src/panels/tests_blend.rs @@ -634,7 +634,9 @@ fn a_secondary_press_on_ramp_while_selecting_another_blend_drops_its_draft_witho Event::PointerMoved(ramp), Event::PointerButton { pos: ramp, button: PointerButton::Secondary, pressed: true, modifiers: Modifiers::NONE }, ]); - assert!(!p.focused_role("Ramp:", Role::SPIN_BUTTON), "a secondary press does not focus Ramp's number field"); + // The number field keeps the focus it had while the draft was typed: a new edit target drops the draft, not the + // focus, and a secondary press moves neither. + assert!(p.focused_role("Ramp:", Role::SPIN_BUTTON), "Ramp's number field keeps the focus"); assert!(!p.focused_role("Ramp:", Role::SLIDER), "a secondary press does not focus Ramp's track"); p.frame_with(vec![Event::PointerButton { pos: ramp, button: PointerButton::Secondary, pressed: false, modifiers: Modifiers::NONE }]); p.key(Key::Enter, Modifiers::NONE); diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs index 72a3e4e0c6..f30bdc8bdb 100644 --- a/crates/ui-egui/src/toolbar.rs +++ b/crates/ui-egui/src/toolbar.rs @@ -507,7 +507,8 @@ fn show_rail(app: &mut VectorcraftApp, ui: &mut Ui, owner: Owner, at: GroupAt, m // Tools without options answer with an error; a double click on one does nothing more. app.run("tool.options", json!({ "tool": tool })).ok(); } - if out.edit_toolbar.as_ref().is_some_and(|button| button.clicked()) { + // A measuring pass of the rail reports the same click as the pass that shows it, and the command toggles the drawer. + if out.edit_toolbar.as_ref().is_some_and(|button| button.clicked()) && !craft::ui::runtime::measure::active(ui.ctx()) { let params = match &owner { Owner::Toolbar(id) => json!({ "toolbar": bar_of(&app.ui, *id).map(|bar| bar.name.clone()) }), _ => json!({}),