diff --git a/crates/engine/src/cmd/fileio/load.rs b/crates/engine/src/cmd/fileio/load.rs index bd21723558..d434dcf6ec 100644 --- a/crates/engine/src/cmd/fileio/load.rs +++ b/crates/engine/src/cmd/fileio/load.rs @@ -308,10 +308,12 @@ fn reads_editing_copy(opts: &LoadOptions) -> bool { /// May a file opened with `opts` open from the editor's own copy of its art without its PDF part /// being imported ([`vectorcraft_eps::ai_layers_alone`]): it reads the editor's copy, on the pages' -/// trim boxes (the crop box asked for, as a file with the editor's copy opens on them), with its -/// type as text? +/// trim boxes by default, with its type as text? fn reads_layers_alone(opts: &LoadOptions) -> bool { - reads_editing_copy(opts) && opts.crop == vectorcraft_pdf::CropTo::Crop && opts.text_as != vectorcraft_pdf::TextAs::Outlines + reads_editing_copy(opts) + && !opts.explicit_crop_box + && opts.crop == vectorcraft_pdf::CropTo::Crop + && opts.text_as != vectorcraft_pdf::TextAs::Outlines } /// The editor's own copy of its art that `opened` carries, decoded ([`decoded_copy`]), when `opts` @@ -475,8 +477,8 @@ pub fn load_with(name: &str, bytes: &[u8], opts: &LoadOptions) -> Result // The file is read and checked once, for the document it carries, its pages, the // editor's copy and its File Info. let opened = vectorcraft_pdf::open_pdf(bytes, opts.password.as_deref()); - // Saved with Preserve Editing: the document it carries, unless some pages are picked. - let editing = (opts.pages.is_none() && opts.native) + // Restore the preserved document when opening all pages at their original size. + let editing = (opts.pages.is_none() && opts.native && !opts.explicit_crop_box) .then(|| opened.as_ref().ok().and_then(|o| o.editing())) .flatten() .map(|e| (e.intact, move || Some(e.data))); @@ -524,7 +526,7 @@ pub fn load_with(name: &str, bytes: &[u8], opts: &LoadOptions) -> Result } None => None, }; - let alone = (r.only_text || empty) + let alone = (!opts.explicit_crop_box && (r.only_text || empty)) .then(copy_alone) .flatten() .and_then(|read| read.ok()) diff --git a/crates/engine/src/cmd/fileio/pdfimport.rs b/crates/engine/src/cmd/fileio/pdfimport.rs index 005cc4a557..2dd408acdc 100644 --- a/crates/engine/src/cmd/fileio/pdfimport.rs +++ b/crates/engine/src/cmd/fileio/pdfimport.rs @@ -173,7 +173,13 @@ impl LoadOptions { /// box, a password, without its hidden layers, without the VectorCraft document it carries, its /// pages linked)? Writing it back would lose the rest, so Save doesn't (it asks for a name). pub fn is_partial(&self) -> bool { - self.pages.is_some() || self.crop != CropTo::default() || self.password.is_some() || !self.layers || !self.native || self.link_pages + self.pages.is_some() + || self.crop != CropTo::default() + || self.explicit_crop_box + || self.password.is_some() + || !self.layers + || !self.native + || self.link_pages } /// The PDF import options: `pages` resolved against the file's page count. A PDF or PDF-compatible diff --git a/crates/engine/src/cmd/fileio/tests_aiimport.rs b/crates/engine/src/cmd/fileio/tests_aiimport.rs index 6e63170f88..3c6343ebea 100644 --- a/crates/engine/src/cmd/fileio/tests_aiimport.rs +++ b/crates/engine/src/cmd/fileio/tests_aiimport.rs @@ -1395,8 +1395,7 @@ fn link_pages_refuses_an_ai_file_saved_without_its_pdf_part() { let _ = std::fs::remove_dir_all(&d); } -/// `document.open` with `linkPages` opens a PDF-compatible `.ai` asked for its crop box on its trim -/// box, as it opens as art, showing its bleed box round the artboard, which is the document's bleed. +/// Linked pages default to the trim box with the bleed and honor an explicit Crop Box. #[test] fn link_pages_open_an_ai_file_on_its_trim_box_with_its_bleed() { let d = std::env::temp_dir().join(format!("vc-ailinkpagestrim-{}", std::process::id())); @@ -1416,6 +1415,13 @@ fn link_pages_open_an_ai_file_on_its_trim_box_with_its_bleed() { let NodeKind::PlacedDocument(p) = &placed.kind else { panic!("{:?}", placed.kind) }; assert_eq!((p.width, p.height, p.page_box), (192.0, 96.0, vectorcraft_doc::PageBox::Bleed)); assert_eq!(p.xf.translation(), vectorcraft_geom::Vec2::new(-6.0, -8.0), "the trim box on the artboard"); + + s.execute("document.open", &json!({"path": path, "linkPages": true, "cropTo": "crop"})).unwrap(); + let cropped = &s.doc().unwrap().doc; + assert!(cropped.artboards[0].rect.width() > board.width()); + let placed = &cropped.layers[0].children().unwrap()[0]; + let NodeKind::PlacedDocument(p) = &placed.kind else { panic!("{:?}", placed.kind) }; + assert_eq!(p.page_box, vectorcraft_doc::PageBox::Crop); let _ = std::fs::remove_dir_all(&d); } diff --git a/crates/engine/src/tests/pathops.rs b/crates/engine/src/tests/pathops.rs index d1b5197012..dd37818799 100644 --- a/crates/engine/src/tests/pathops.rs +++ b/crates/engine/src/tests/pathops.rs @@ -3,7 +3,7 @@ use serde_json::{Value, json}; use vectorcraft_color::{Color, Paint}; use vectorcraft_doc::{Appearance, NodeKind}; -use vectorcraft_geom::{FillRule, PathData, Rect}; +use vectorcraft_geom::{FillRule, PathData, Point, Rect, SubPath}; use crate::*; @@ -211,6 +211,33 @@ fn exclude_makes_compound() { assert!((area_of(&s, r[0]) - 15000.0).abs() < 1.0); } +#[test] +fn divide_over_work_budget_preserves_art_and_selection() { + let mut s = session(); + let square = rect(&mut s, 0.0, 0.0, 100.0, 100.0); + let line = s.execute("shape.line", &json!({"x1": -10, "y1": -10, "x2": 110, "y2": 110})).unwrap(); + let cutter = NodeId(line["id"].as_u64().unwrap()); + // The existing pathops work-budget fixture uses 1,500 overlapping lines. + // Put them in one open path so the setup only makes two document objects. + let line = SubPath::polyline(&[Point::new(-10.0, -10.0), Point::new(110.0, 110.0)], false); + s.edit("complex cutter", |d, _| { + let NodeKind::Path { path, .. } = &mut d.node_mut(cutter).unwrap().kind else { panic!("expected a path") }; + *path = PathData::new(vec![line; 1_500]); + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [square.0, cutter.0]})).unwrap(); + let before = s.doc().unwrap().doc.clone(); + let selection = s.doc().unwrap().selection.clone(); + let undo = s.doc().unwrap().history.undo.len(); + let error = s.execute("object.pathfinder.divide", &json!({})).unwrap_err().to_string(); + assert!(error.contains("too many segments or pieces"), "{error}"); + let state = s.doc().unwrap(); + assert!(std::sync::Arc::ptr_eq(&state.doc, &before), "the original document must be restored"); + assert_eq!(state.selection, selection); + assert_eq!(state.history.undo.len(), undo); +} + #[test] fn divide_produces_group_of_faces() { let mut s = session(); diff --git a/crates/engine/src/tests/script_io.rs b/crates/engine/src/tests/script_io.rs index b5d7fe7ded..527408f06e 100644 --- a/crates/engine/src/tests/script_io.rs +++ b/crates/engine/src/tests/script_io.rs @@ -19,7 +19,7 @@ fn folder(name: &str) -> PathBuf { let base = std::env::temp_dir().join(format!("vc-script-io-{name}-{}", std::process::id())); let _ = std::fs::remove_dir_all(&base); std::fs::create_dir_all(base.join("main")).unwrap(); - std::fs::canonicalize(&base).unwrap() + crate::cmd::findfiles::plain(std::fs::canonicalize(&base).unwrap()) } fn write(path: &Path, bytes: &[u8]) { diff --git a/crates/engine/src/tests/script_xmp.rs b/crates/engine/src/tests/script_xmp.rs index 687df5cd0e..82a0de2a6c 100644 --- a/crates/engine/src/tests/script_xmp.rs +++ b/crates/engine/src/tests/script_xmp.rs @@ -57,7 +57,7 @@ impl AsRef for Folder { /// A fresh folder for test `name`, with a `main` folder inside it for the script, by its real path. fn folder(name: &str) -> Folder { let guard = vectorcraft_testkit::TempDir::new(&format!("script-xmp-{name}")); - let base = std::fs::canonicalize(&*guard).unwrap(); + let base = crate::cmd::findfiles::plain(std::fs::canonicalize(&*guard).unwrap()); std::fs::create_dir_all(base.join("main")).unwrap(); Folder { _guard: guard, path: base } } diff --git a/crates/tools/src/option_check.rs b/crates/tools/src/option_check.rs index 5871d07126..cc00d06a3d 100644 --- a/crates/tools/src/option_check.rs +++ b/crates/tools/src/option_check.rs @@ -171,7 +171,7 @@ mod tests { (TYPE, &["editing"]), (&["puppetWarp"], &["pins", "selected"]), // With nothing queued, `current` (0) is no file's index either. - (&["place"], &["count", "current", "sourceIndex", "name", "width", "height", "names"]), + (&["place"], &["count", "total", "current", "sourceIndex", "name", "width", "height", "names"]), ]; let read_only = |id: &str, k: &str| READ_ONLY.iter().any(|(ids, keys)| ids.contains(&id) && keys.contains(&k)); // Tools that `create` makes and the catalog doesn't list. diff --git a/crates/tools/src/place.rs b/crates/tools/src/place.rs index 84f6ee1bad..454b1128ac 100644 --- a/crates/tools/src/place.rs +++ b/crates/tools/src/place.rs @@ -32,6 +32,8 @@ struct Entry { #[derive(Default)] pub struct PlaceTool { entries: Vec, + /// How many files the last load held, before any was placed or discarded. + total: usize, current: usize, /// The tool to return to when the last file is placed or discarded. prev: Option, @@ -67,6 +69,7 @@ impl PlaceTool { } if self.entries.is_empty() { self.current = 0; + self.total = 0; return vec![Action::SwitchTool(self.prev.clone().unwrap_or_else(|| "selection".into()))]; } self.current %= self.entries.len(); @@ -153,11 +156,13 @@ impl Tool for PlaceTool { Cursor::Crosshair } - /// `{count, current, sourceIndex, name, width, height, names}`: what the cursor holds (no file data). + /// `{count, total, current, sourceIndex, name, width, height, names}`: what the cursor holds (no file data); + /// `total` is how many files the load held. fn options(&self) -> Value { let e = self.entry(); json!({ "count": self.entries.len(), + "total": self.total, "current": self.current, "sourceIndex": e.map(|e| e.source_index), "name": e.map(|e| &e.name), @@ -187,6 +192,7 @@ impl Tool for PlaceTool { }) }) .collect(); + self.total = entries.len(); self.entries = entries; self.current = 0; self.drag = None; @@ -233,6 +239,7 @@ impl Tool for PlaceTool { /// Switching tools discards what the cursor holds. fn deactivate(&mut self, _cx: &ToolContext) -> Vec { self.entries.clear(); + self.total = 0; self.drag = None; vec![] } @@ -399,6 +406,30 @@ mod tests { assert_eq!(t.key(&c, ToolKey::Escape, Mods::default()), vec![Action::SwitchTool("pen".into())]); } + #[test] + fn the_total_is_the_size_of_the_load_until_the_cursor_empties() { + let (d, _) = doc_with_rect(); + let (s, p) = (Default::default(), paint()); + let c = cx(&d, &s, &p); + let counts = |t: &PlaceTool| (t.options()["count"].clone(), t.options()["total"].clone()); + let mut t = loaded(3); + assert_eq!(counts(&t), (json!(3), json!(3))); + t.pointer(&c, &ev(PointerKind::Down, 0.0, 0.0)); + t.pointer(&c, &ev(PointerKind::Up, 0.0, 0.0)); + assert_eq!(counts(&t), (json!(2), json!(3)), "a placed file leaves the total"); + t.key(&c, ToolKey::Escape, Mods::default()); + assert_eq!(counts(&t), (json!(1), json!(3)), "a discarded file leaves the total"); + // A new load replaces the total, and an empty cursor has none. + let mut t = loaded(3); + t.set_option("queue", &json!({"entries": [{"params": {"path": "g.png"}, "name": "g.png", "width": 4.0, "height": 2.0}]})); + assert_eq!(counts(&t), (json!(1), json!(1))); + t.key(&c, ToolKey::Escape, Mods::default()); + assert_eq!(counts(&t), (json!(0), json!(0))); + let mut t = loaded(2); + t.deactivate(&c); + assert_eq!(counts(&t), (json!(0), json!(0))); + } + #[test] fn source_indices_survive_removal_in_cursor_requests() { let (d, _) = doc_with_rect(); diff --git a/crates/ui-egui/src/addons/pathtools/corner.rs b/crates/ui-egui/src/addons/pathtools/corner.rs index f24542b81d..6c2d9f2b11 100644 --- a/crates/ui-egui/src/addons/pathtools/corner.rs +++ b/crates/ui-egui/src/addons/pathtools/corner.rs @@ -134,7 +134,7 @@ mod tests { let undo = panel.app().session.active().unwrap().history.undo.len(); panel.click_role(label, Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); - panel.type_text(typed); + panel.type_text(&crate::tests::regional_text(typed)); panel.frame(); let proposed = panel.app().session.tool_options_of(tool); assert_ne!(proposed[key], before[key], "{label} changes while typing"); diff --git a/crates/ui-egui/src/addons/shapes.rs b/crates/ui-egui/src/addons/shapes.rs index 5e25b913c9..d922864054 100644 --- a/crates/ui-egui/src/addons/shapes.rs +++ b/crates/ui-egui/src/addons/shapes.rs @@ -663,7 +663,7 @@ mod cancel_tests { panel.frame(); panel.click_role("TL", Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); - panel.type_text("4.125"); + panel.type_text(&crate::tests::regional_text("4.125")); panel.frame(); let proposed = panel.app().session.tool_options(); assert_ne!(proposed["cornerRadii"], before["cornerRadii"]); diff --git a/crates/ui-egui/src/app/view.rs b/crates/ui-egui/src/app/view.rs index a1ab70c788..cf8983e17f 100644 --- a/crates/ui-egui/src/app/view.rs +++ b/crates/ui-egui/src/app/view.rs @@ -11,7 +11,8 @@ pub(crate) fn navigation(p: &Prefs) -> NavigationOptions { let mut options = NavigationOptions::default(); options.wheel = if p.zoom_with_mouse_wheel { WheelScheme::Zoom } else { WheelScheme::Scroll }; options.animated_zoom = crate::canvas::animated_zoom(p); - options.scrubby_zoom = crate::canvas::animated_zoom(p); + options.eased_wheel_zoom = p.zoom_with_mouse_wheel && options.animated_zoom; + options.scrubby_zoom = options.animated_zoom; options.trackpad_rotate = p.trackpad_rotate_view; options.touch_gestures = p.touch_gestures; options.overscroll = true; diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index ef40ffefe4..5ac45da71d 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -25,8 +25,8 @@ const TIP: PartKey = PartKey::new("tip"); const CHIP: f32 = 5.0; const CHIP_RIM: f32 = 6.0; const CHIP_RING: f32 = 8.0; -/// Where the Selection tool's rule badge sits from the pointer, in points. -const BADGE_OFFSET: Vec2 = Vec2::new(14.0, 14.0); +/// Where the Selection tool's rule badge and the loaded place cursor's file sit from the pointer, in points. +pub(super) const BADGE_OFFSET: Vec2 = Vec2::new(14.0, 14.0); /// Shows `overlays` (the session's list, read after the tool host ran) over `extra` (the thread and gap overlays), /// on the canvas of `space`. The extras lie under the tool's own marks. diff --git a/crates/ui-egui/src/canvas/rulers/tests.rs b/crates/ui-egui/src/canvas/rulers/tests.rs index 4e0c3342b3..a523eab866 100644 --- a/crates/ui-egui/src/canvas/rulers/tests.rs +++ b/crates/ui-egui/src/canvas/rulers/tests.rs @@ -257,6 +257,6 @@ fn ruler_labels_carry_the_sign_and_the_steps_decimals() { (1.0, 0.0625, "1"), (1.1875, 0.0625, "1.1875"), ] { - assert_eq!(x.tick_label(&units, value, step), want, "the tick at {value} of a {step} step"); + assert_eq!(x.tick_label(&units, value, step), crate::tests::regional_text(want), "the tick at {value} of a {step} step"); } } diff --git a/crates/ui-egui/src/canvas/tool_adapter.rs b/crates/ui-egui/src/canvas/tool_adapter.rs index c7d13cc96c..4edaa65945 100644 --- a/crates/ui-egui/src/canvas/tool_adapter.rs +++ b/crates/ui-egui/src/canvas/tool_adapter.rs @@ -866,7 +866,8 @@ fn host_run_session(tool: &mut SessionTool<'_>, ui: &Ui, pass: &ToolPass) -> Too response } -/// The session's overlays, then the text threads and Live Paint gaps under them, shown over the picture. +/// The session's overlays, then the text threads and Live Paint gaps under them, shown over the picture, and the +/// loaded place cursor's file over them. fn show_overlays(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass, view_info: ViewInfo) { let Some(space) = pass.space else { return }; let revolve = crate::dialogs::three_d::gizmo_shown(app); @@ -892,6 +893,18 @@ fn show_overlays(app: &mut VectorcraftApp, ui: &mut Ui, pass: &ToolPass, view_in } } super::overlays::show(app, ui, &space, &list, &extra); + // The loaded place cursor shows its current file and the files left beside the pointer, while the canvas has the + // pointer and no view tool is held. A press that began on the canvas keeps `hover_doc` while it is dragged off it, + // so the pointer must also be over the canvas. + if app.session.tool_id() == "place" + && app.ui.screen_mode < 3 + && app.hover_doc.is_some() + && !view_tool_held(app) + && let Some(at) = ui.input(|i| i.pointer.hover_pos()) + && space.view.rect.contains(at) + { + crate::place::cursor_overlay(app, ui, at, space.view.rect, super::overlays::BADGE_OFFSET); + } } /// Whether the canvas has a tool gesture in progress. Only the current window's body is live: panes and the other diff --git a/crates/ui-egui/src/dialogs/artboard_options.rs b/crates/ui-egui/src/dialogs/artboard_options.rs index 4ca5f2fc23..6c1599a5ab 100644 --- a/crates/ui-egui/src/dialogs/artboard_options.rs +++ b/crates/ui-egui/src/dialogs/artboard_options.rs @@ -825,7 +825,7 @@ mod tests { assert_eq!(pending.size_choice, Some(ArtboardSizeChoice::Orientation(true))); panel.click_role(label, Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); - panel.type_text(typed); + panel.type_text(&crate::tests::regional_text(typed)); assert_eq!(actual_value(&panel), pending, "typing must not discard the pending orientation or reference-point policy"); panel.key(Key::Escape, Modifiers::NONE); assert!(!is_open(&panel.app()), "Escape discards the modal for {label}"); @@ -875,7 +875,7 @@ mod tests { panel.frame(); panel.click_role(label, Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); - panel.type_text(typed); + panel.type_text(&crate::tests::regional_text(typed)); if blur { panel.key(Key::Tab, Modifiers::NONE); } diff --git a/crates/ui-egui/src/dialogs/tests_import_pdf.rs b/crates/ui-egui/src/dialogs/tests_import_pdf.rs index ab2bd34908..2fc635abd9 100644 --- a/crates/ui-egui/src/dialogs/tests_import_pdf.rs +++ b/crates/ui-egui/src/dialogs/tests_import_pdf.rs @@ -381,16 +381,22 @@ fn two_pages(editing_data: bool, password: Option<&str>) -> Vec { /// Two 100 pt pages and, on the first, editing data with two artboards to match and a layer of its /// own, which draws the square the first page draws. -fn two_pages_with_a_layer_in_the_editing_data(layer: &str) -> Vec { +fn two_pages_with_a_layer_in_the_editing_data(layer: &str, with_trim_box: bool) -> Vec { let point = |x: i32, y: i32, n: u8| format!("%_{x} {y} /RealPointRelToROrigin\n%_ (PositionPoint{n}) ,\n"); let board = |top: i32| format!("%_/Dictionary :\n{}{}%_; ,\n", point(0, top, 1), point(100, top - 100, 2)); let boards = format!("%_/Document :\n%_/Dictionary :\n%_/Array :\n{}{}%_; (ArtboardArray) ,\n%_; /NotRecorded ,\n%_;\n", board(100), board(-50)); let art = format!("0 0 0 1 k\n{}f\n", ai::rect(10.0, 10.0, 30.0, 30.0)); let data = ai::editing_data(100.0, 100.0, &format!("{boards}{}", ai::layer(layer, &art))); - let mut first = PdfPage::new(100.0, 100.0, "0 0 0 1 k 10 10 20 20 re f"); + let page = |content| { + let edge = if with_trim_box { 120.0 } else { 100.0 }; + let mut page = PdfPage::new(edge, edge, content); + page.trim = with_trim_box.then_some([10.0, 10.0, 110.0, 110.0]); + page + }; + let mut first = page("0 0 0 1 k 10 10 20 20 re f"); first.entries = format!("/PieceInfo << /Illustrator << /Private << /AIPrivateData1 {} 0 R /NumBlock 1 >> >> >>", first_extra(2)); let stream = format!("<< /Length {} >>\nstream\n{data}\nendstream", data.len()); - pdf_with(&[first, PdfPage::new(100.0, 100.0, "")], &[&stream], None) + pdf_with(&[first, page("")], &[&stream], None) } /// #6135: the editing data of a `.ai` holds every artboard, so opening one asks nothing, opens @@ -398,7 +404,7 @@ fn two_pages_with_a_layer_in_the_editing_data(layer: &str) -> Vec { #[test] fn opening_an_ai_with_editing_data_reads_it_without_asking() { let mut app = app(); - let bytes = two_pages_with_a_layer_in_the_editing_data("Only in the editing data"); + let bytes = two_pages_with_a_layer_in_the_editing_data("Only in the editing data", false); io::open_bytes(&mut app, "two.ai", &bytes, Some("/tmp/two.ai".into())).unwrap(); assert!(!is_open(&app), "no Import PDF dialog"); assert_eq!(app.session.documents().len(), 2); @@ -435,6 +441,17 @@ fn opening_a_pdf_with_editing_data_keeps_its_trim_boxes_unless_a_box_is_picked() confirm(&mut app).unwrap(); assert_eq!(artboard_widths(&app), [100.0, 200.0], "an explicit crop box"); + let bytes = two_pages_with_a_layer_in_the_editing_data("An editable layer", true); + let mut app = self::app(); + assert!(import_pdf::offer(&mut app, "readable.pdf", &bytes, None, None)); + confirm(&mut app).unwrap(); + assert_eq!(artboard_widths(&app), [100.0, 100.0], "the trim boxes match the artboards in the editing data"); + let mut app = self::app(); + assert!(import_pdf::offer(&mut app, "readable.pdf", &bytes, None, None)); + set(&mut app, "cropTo", json!("crop")); + confirm(&mut app).unwrap(); + assert_eq!(artboard_widths(&app), [120.0, 120.0], "the crop boxes override the artboards in the editing data"); + let mut app = self::app(); assert!(import_pdf::offer(&mut app, "locked.pdf", &trimmed(Some("pw")), None, None)); set(&mut app, "password", json!("pw")); diff --git a/crates/ui-egui/src/dialogs/variation.rs b/crates/ui-egui/src/dialogs/variation.rs index 9ce39bc031..9b97e2d2e0 100644 --- a/crates/ui-egui/src/dialogs/variation.rs +++ b/crates/ui-egui/src/dialogs/variation.rs @@ -131,7 +131,7 @@ mod tests { for (label, text) in [("Value", typed), ("Variation:", variation)] { panel.click_role(label, Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); - panel.type_text(text); + panel.type_text(&crate::tests::regional_text(text)); panel.key(Key::Escape, Modifiers::NONE); assert!(!panel.app().dialogs().unwrap().with(|host| host.is_open::())); assert_eq!(panel.app().session.tool_options_of(tool), original, "the canceled {label} leaves the tool unchanged"); @@ -143,7 +143,7 @@ mod tests { for (label, text) in [("Value", typed), ("Variation:", variation)] { panel.click_role(label, Role::SPIN_BUTTON); panel.key(Key::A, Modifiers::COMMAND); - panel.type_text(text); + panel.type_text(&crate::tests::regional_text(text)); panel.key(Key::Tab, Modifiers::NONE); } panel.click_role("Mode", Role::COMBO_BOX); diff --git a/crates/ui-egui/src/panel_docking.rs b/crates/ui-egui/src/panel_docking.rs index 37090a916d..e5b0110b77 100644 --- a/crates/ui-egui/src/panel_docking.rs +++ b/crates/ui-egui/src/panel_docking.rs @@ -1076,6 +1076,12 @@ fn run(app: &mut VectorcraftApp, actions: Vec>, reveal: Option