diff --git a/crates/engine/src/cmd/atn_cmds/steps_content_aware.rs b/crates/engine/src/cmd/atn_cmds/steps_content_aware.rs index db5dc59a647..150a686b6a6 100644 --- a/crates/engine/src/cmd/atn_cmds/steps_content_aware.rs +++ b/crates/engine/src/cmd/atn_cmds/steps_content_aware.rs @@ -12,15 +12,7 @@ const COLOR: &[(&str, &str)] = &[("cafColorAdaptationDefault", "default")]; const ROTATION: &[(&str, &str)] = &[("cafRotationAmountNone", "none")]; // Current Layer is also explicit in the primary Action Manager example cited in docs/atn.md. const OUTPUT: &[(&str, &str)] = &[("cafOutputToNewLayer", "new"), ("cafOutputToCurrentLayer", "current")]; -const KEYS: &[&str] = &[ - "cafSamplingRegion", - "cafSampleAllLayers", - "cafColorAdaptationLevel", - "cafRotationAmount", - "cafScale", - "cafMirror", - "cafOutput", -]; +const KEYS: &[&str] = &["cafSamplingRegion", "cafSampleAllLayers", "cafColorAdaptationLevel", "cafRotationAmount", "cafScale", "cafMirror", "cafOutput"]; const PARAMS: &[&str] = &["sampling", "sampleAllLayers", "colorAdaptation", "rotationAdaptation", "scale", "mirror", "output"]; /// All seven settings are recorded. Missing keys have no measured Photoshop default here. @@ -29,12 +21,7 @@ fn recorded(d: &Descriptor) -> Option { return None; } let mut p = Map::new(); - for (key, param, table) in [ - (KEYS[0], PARAMS[0], SAMPLING), - (KEYS[2], PARAMS[2], COLOR), - (KEYS[3], PARAMS[3], ROTATION), - (KEYS[6], PARAMS[6], OUTPUT), - ] { + for (key, param, table) in [(KEYS[0], PARAMS[0], SAMPLING), (KEYS[2], PARAMS[2], COLOR), (KEYS[3], PARAMS[3], ROTATION), (KEYS[6], PARAMS[6], OUTPUT)] { let D::Enumerated { type_id, value } = d.get(key)? else { return None }; if !type_id.is(key) { return None; diff --git a/crates/engine/tests/it/atn_content_aware_fill.rs b/crates/engine/tests/it/atn_content_aware_fill.rs index 0bb798d2bde..f7f3c3e6477 100644 --- a/crates/engine/tests/it/atn_content_aware_fill.rs +++ b/crates/engine/tests/it/atn_content_aware_fill.rs @@ -166,11 +166,7 @@ fn caf_unrepresented_descriptors_are_kept_and_never_partially_play() { /// Known native defaults become explicit values; unsupported defaults/options cannot disappear. #[test] fn caf_native_exports_preserve_effective_defaults_and_refuse_unrepresented_options() { - for p in [ - json!({"sampling":"rectangular","output":"new"}), - json!({"sampling":"rectangular","output":"new","seed":1,"target":"pixels"}), - params(), - ] { + for p in [json!({"sampling":"rectangular","output":"new"}), json!({"sampling":"rectangular","output":"new","seed":1,"target":"pixels"}), params()] { let a = load(exported(p).unwrap().descriptor.unwrap()); assert_eq!(a.steps, vec![(CMD.into(), params())]); } @@ -181,14 +177,29 @@ fn caf_native_exports_preserve_effective_defaults_and_refuse_unrepresented_optio assert_eq!(a.steps, vec![(CMD.into(), current.clone())]); } for (key, value) in [ - ("sampling", json!("auto")), ("sampling", json!("custom")), ("sampling", json!("unknown")), + ("sampling", json!("auto")), + ("sampling", json!("custom")), + ("sampling", json!("unknown")), ("output", json!("duplicate")), - ("colorAdaptation", json!("none")), ("colorAdaptation", json!("high")), ("colorAdaptation", json!("veryHigh")), - ("rotationAdaptation", json!("low")), ("rotationAdaptation", json!("medium")), - ("rotationAdaptation", json!("high")), ("rotationAdaptation", json!("full")), - ("sampleAllLayers", json!(0)), ("scale", Value::Null), ("mirror", json!("true")), ("seed", json!(2)), - ("layer", json!(1)), ("margin", json!(10)), ("area", json!([0,0,4,4])), ("channel", json!(0)), - ("samplingStrokes", json!([])), ("fillEdits", json!([])), ("target", json!("mask")), ("_atnCafDescriptor", Value::Null), + ("colorAdaptation", json!("none")), + ("colorAdaptation", json!("high")), + ("colorAdaptation", json!("veryHigh")), + ("rotationAdaptation", json!("low")), + ("rotationAdaptation", json!("medium")), + ("rotationAdaptation", json!("high")), + ("rotationAdaptation", json!("full")), + ("sampleAllLayers", json!(0)), + ("scale", Value::Null), + ("mirror", json!("true")), + ("seed", json!(2)), + ("layer", json!(1)), + ("margin", json!(10)), + ("area", json!([0, 0, 4, 4])), + ("channel", json!(0)), + ("samplingStrokes", json!([])), + ("fillEdits", json!([])), + ("target", json!("mask")), + ("_atnCafDescriptor", Value::Null), ] { let mut p = params(); p[key] = value;