From 2a6fb517384f968f7a759d54a2eafe91ab61d654 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Mon, 30 Nov 2026 14:07:03 -0800 Subject: [PATCH] Use an engine-core fixture for Transform Again --- .../src/cmd/transform_again_needs_prior_tests.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/engine-core/src/cmd/transform_again_needs_prior_tests.rs b/crates/engine-core/src/cmd/transform_again_needs_prior_tests.rs index 52a9b164ab..dd34796639 100644 --- a/crates/engine-core/src/cmd/transform_again_needs_prior_tests.rs +++ b/crates/engine-core/src/cmd/transform_again_needs_prior_tests.rs @@ -1,3 +1,4 @@ +use photocraft_geom::Rect; use serde_json::json; #[test] @@ -8,9 +9,12 @@ fn transform_again_is_enabled_only_after_a_transform_in_the_session() { session.execute("file.new", json!({"width": 100, "height": 100})).unwrap(); session.execute("layer.new.layer", json!({"name": "Pixels"})).unwrap(); - session.execute("select.rect", json!({"x": 10, "y": 10, "width": 25, "height": 20})).unwrap(); - session.execute("edit.fill", json!({"color": "#ff0000"})).unwrap(); - session.execute("select.deselect", json!({})).unwrap(); + session + .edit("Paint fixture", |doc, active| { + doc.layer_mut(active.unwrap()).unwrap().surface_mut().unwrap().fill_rect(Rect::new(10, 10, 35, 30), &[1.0, 0.0, 0.0, 1.0]); + Ok(()) + }) + .unwrap(); assert!(!session.is_enabled(command), "ordinary document edits do not enable Again"); let history = session.active().unwrap().history.past_len(); let error = session.execute(command, json!({})).unwrap_err().to_string();