PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Cover Extras restoration through actual layer thumbnail clicks
jonathnwxh6fc1004b5056
diff --git a/crates/ui-egui/src/path_selection_tests.rs b/crates/ui-egui/src/path_selection_tests.rsindex b4aaa9e50..a1cec5806 100644--- a/crates/ui-egui/src/path_selection_tests.rs+++ b/crates/ui-egui/src/path_selection_tests.rs@@ -331,3 +331,24 @@ fn path_overlay_drawn_for_non_vector_tools() {the path must be drawn regardless of the active tool",);}++#[test]+fn thumbnail_selection_after_hiding_extras_restores_outline() {+ let mut h = harness();+ let shape =+ h.state_mut().run("shape.create", json!({"kind":"rect","rect":[40,20,60,40],"fill":"#cc3333","name":"Badge"})).unwrap()["layer"].as_u64().unwrap();+ let active = h.state_mut().run("layer.new.layer", json!({"name":"Other"})).unwrap()["layer"].as_u64().unwrap();+ panel(&mut h, 0);+ let ctx = h.ctx.clone();+ crate::menus::invoke(h.state_mut(), &ctx, "view.extras", json!({})).unwrap();+ assert!(!h.state().ui.view.extras);+ let row = crate::layer_row_ui::recorded(&h.ctx).into_iter().find(|r| r.layer == shape).unwrap();+ click(&mut h, row.name.unwrap().center(), command());+ assert!(!h.state().ui.view.extras, "selecting layers must not reveal Extras");+ h.state_mut().run("layer.select", json!({"layer": active})).unwrap();+ h.run_steps(2);+ click(&mut h, egui::pos2(row.row.left() + 46.0, row.row.center().y), command());+ assert_eq!(selection(&h), Some([40, 20, 60, 40]));+ assert!(h.state().ui.view.shows(h.state().ui.view.show.selection_edges), "Ctrl-clicking the thumbnail reveals the new selection");+ assert_eq!(h.state().session.active().unwrap().active_layer, Some(photocraft_doc::LayerId(active)));+}