From 5ed83e0daa20af6d7520685b4e8052503da5c4e9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 06:39:46 -0800 Subject: [PATCH] Gradients: an aligned row of a graph design's art alone is still checked by paint.editGradient With only the art of a graph design in a series given, paint.editGradient returned before it checked an explicit aligned item, so a row the art lacks, or one no other object has, was accepted instead of refused. The row is now checked first, as paint.setFill does. --- crates/engine/src/cmd/gradient.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/gradient.rs b/crates/engine/src/cmd/gradient.rs index b7eb7235f6..00575695d4 100644 --- a/crates/engine/src/cmd/gradient.rs +++ b/crates/engine/src/cmd/gradient.rs @@ -579,12 +579,14 @@ fn edit_gradient(s: &mut Session, p: &Value) -> Result { }; let new_default = apply_gradient_edit_in_model(&default_paint, &with_stored_stops(&for_default, &default_paint, &stored), None, &|_| true, model) .map_err(|e| bad(C, e))?; + let of = super::appearance::reference_of(s, p, item, C)?; // Only design art was given or selected: nothing changes, the defaults and the remembered paint included. if selected && ids.is_empty() { + // An aligned `item` of the art alone is still checked: a row the art lacks, or that no other object has, is an error. + edit_items(s, &ids, item, of, C, "Gradient", !stroke, |_, _| Ok(()))?; return Ok(json!({"ids": []})); } let freeform = str_param(p, "kind").and_then(GradientKind::parse) == Some(GradientKind::Freeform); - let of = super::appearance::reference_of(s, p, item, C)?; let shown_at = super::appearance::first_edited(s, item, of, &ids); // The objects returned: with a design's art, those with a row equal to the art's. let edited = edit_items(s, &ids, item, of, C, "Gradient", !stroke, |n, index| {