From 7741e781d7dc4d775755eea70f11401be35705d4 Mon Sep 17 00:00:00 2001 From: hnoerenberg Date: Tue, 24 Nov 2026 01:46:53 +0100 Subject: [PATCH] test(ui-egui): the dialog's refused-name guard covers the centred key too #12090's centred route captures a "centred" key next to the anchor point in the Paragraph Text Size dialog's state, so the guard that refuses names the dialog does not show as fields now covers it too: a control set_json_field for "centred" is refused like the anchor, the document and the settings snapshot. This widens the guard's coverage, it does not flip a failing test. One guard comment in the #12090 test module is reworded into plain English. --- crates/ui-egui/src/dialogs/paragraph_text_size/tests.rs | 2 +- .../ui-egui/src/tools/type_tool/vertical_mask_alt_drag_tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/paragraph_text_size/tests.rs b/crates/ui-egui/src/dialogs/paragraph_text_size/tests.rs index 475d1716d9c..7a5b52400d0 100644 --- a/crates/ui-egui/src/dialogs/paragraph_text_size/tests.rs +++ b/crates/ui-egui/src/dialogs/paragraph_text_size/tests.rs @@ -321,7 +321,7 @@ fn a_name_the_dialog_does_not_show_as_a_field_is_refused() { drag(&mut app, [10.0, 10.0], [109.5, 60.0], Modifiers::ALT, Modifiers::ALT); let (id, _) = only_dialog(&app); let ctx = app.ctx().clone(); - for field in ["at", "document", "settings", "box", "text"] { + for field in ["at", "document", "settings", "centred", "box", "text"] { assert!(app.framework.dialogs.set_json_field(&ctx, id, field, json!(1.0)).is_err(), "`{field}` is not a field of this dialog"); } assert_eq!(only_dialog(&app).1["width"].as_f64(), Some(99.5), "and the two real fields keep the dragged size"); diff --git a/crates/ui-egui/src/tools/type_tool/vertical_mask_alt_drag_tests.rs b/crates/ui-egui/src/tools/type_tool/vertical_mask_alt_drag_tests.rs index 83c7f90c134..039ddfd2640 100644 --- a/crates/ui-egui/src/tools/type_tool/vertical_mask_alt_drag_tests.rs +++ b/crates/ui-egui/src/tools/type_tool/vertical_mask_alt_drag_tests.rs @@ -216,7 +216,7 @@ fn an_alt_click_without_a_drag_still_starts_a_point_mask() { assert_eq!([t.transform.m[4], t.transform.m[5]], [50.0, 100.0]); } -/// Guard (pattern 4, scope): the ticket measured the Vertical Type Mask tool, so the Horizontal +/// Guard: pins that the ticket measured the Vertical Type Mask tool only, so the Horizontal /// Type Mask tool keeps today's gesture — an Alt+drag there commits the plain box at once. #[test] fn an_alt_drag_with_the_horizontal_type_mask_tool_still_makes_the_box_directly() {