PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Layers panel: document layer_row and the click test helper
tessillustrations-droid3e6af6b5d8a1
diff --git a/crates/ui-egui/src/layer_row_ui/tests.rs b/crates/ui-egui/src/layer_row_ui/tests.rsindex 28e0b9d8a..48be73e0a 100644--- a/crates/ui-egui/src/layer_row_ui/tests.rs+++ b/crates/ui-egui/src/layer_row_ui/tests.rs@@ -123,6 +123,7 @@ fn a_groups_layers_indent_past_the_group() {assert!((left(group) - left(top) - step).abs() < 0.5, "a top-level layer keeps its place: {} vs group {}", left(top), left(group));}+/// A primary click at `at`: hover, press and release a frame apart, then let the panel settle.fn click(h: &mut Harness<'_, PhotocraftApp>, at: Pos2) {h.hover_at(at);h.run_steps(1);diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rsindex 6bd8543ce..5bc3e4eb9 100644--- a/crates/ui-egui/src/panels.rs+++ b/crates/ui-egui/src/panels.rs@@ -2975,6 +2975,8 @@ fn paint_clipping_indicator(painter: &egui::Painter, at: Pos2, color: Color32) {painter.add(egui::Shape::line(vec![at + vec2(2.0, 0.0), tip, at + vec2(8.0, 0.0)], stroke));}+/// One row of the Layers panel for `l`, `depth` levels inside groups or artboards: it paints the+/// row, queues what a click or drag on it asks for in `actions`, and returns the row's rect.#[allow(clippy::too_many_arguments)]fn layer_row(app: &mut PhotocraftApp,