Auto-Align Layers: the dialog no longer sends reference 0 (#674) (#795)

* fix(dialogs): Auto-Align no longer sends reference 0 (#674)

* style(xtask): rustfmt the i18n coverage test
This commit is contained in:
reese 2026-10-07 16:46:13 -05:00 committed by GitHub
parent 38d23b621f
commit 4b80b031bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

View File

@ -85,7 +85,7 @@ pub fn parse_spec(spec: &str) -> Vec<Param> {
Kind::Text
} else if v == "doc" {
Kind::Document
} else if v == "json" || v.starts_with('[') || v.starts_with('{') {
} else if v == "json" || v.starts_with("layer id") || v.starts_with('[') || v.starts_with('{') {
Kind::Json
} else if let Some(n) = v.strip_prefix("int[").and_then(|r| r.strip_suffix(']')).and_then(|n| n.parse().ok()) {
Kind::Grid(n)
@ -453,6 +453,16 @@ mod tests {
);
}
/// A layer-id param has no number field: drawing the Auto-Align dialog used to write
/// `reference: 0` back, which the engine rejects as not a selected layer (#674).
#[test]
fn layer_id_params_stay_out_of_the_dialog() {
let mut f = Map::new();
f.insert("__command".into(), json!("edit.autoAlignLayers"));
egui::Context::default().run_ui(Default::default(), |ui| body(ui, &mut f)).textures_delta.clear();
assert!(!params_of(&f).as_object().unwrap().contains_key("reference"), "{f:?}");
}
#[test]
fn wide_positive_ranges_use_the_logarithmic_slider_path() {
assert!(uses_logarithmic_slider(0.1, 1000.0), "Gaussian Blur radius");