From 489552c14b708fc370f6dbb8ce4b868e0497e980 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 16:21:46 -0800 Subject: [PATCH] Simplify: the slider's Escape test previews level 0, which changes the path The test's path zigzags by 0.1 pt. At level 100 the tolerance is 1/32 pt, and a fit now stays within it, so the preview at that level leaves the path as it was. Level 0's 32 pt tolerance takes the zigzag out. --- crates/ui-egui/src/dialogs/tests_modal.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/tests_modal.rs b/crates/ui-egui/src/dialogs/tests_modal.rs index 95ff410ca..c20209410 100644 --- a/crates/ui-egui/src/dialogs/tests_modal.rs +++ b/crates/ui-egui/src/dialogs/tests_modal.rs @@ -453,9 +453,10 @@ fn simplify_slider_escape_puts_the_paths_back() { let undo_len = app.session.doc().unwrap().history.undo.len(); crate::menus::invoke(&mut app, "object.path.simplify", json!({})); settle(&ctx, &mut app); + // Level 0's tolerance of 32 pt takes out the path's 0.1 pt zigzag; level 100's 1/32 pt keeps it. let (_, _, rail, _) = slider_strip(&ctx); - drag(&ctx, &mut app, rail, vec2(100.0, 0.0)); - assert_eq!(simplify_preview(&app), json!({"level": 100.0})); + drag(&ctx, &mut app, rail + vec2(90.0, 0.0), vec2(-190.0, 0.0)); + assert_eq!(simplify_preview(&app), json!({"level": 0.0})); assert_ne!(app.session.doc().unwrap().doc, before, "the preview changes the path"); let escape = Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }; let input = egui::RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, SCREEN)), events: vec![escape], ..Default::default() };