mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-10 11:11:30 +00:00
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.
This commit is contained in:
@@ -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() };
|
||||
|
||||
Reference in New Issue
Block a user