Rename gradient type to gradient form (#4405)

* Rename gradient type to gradient form

* Update the demo art for the gradient form rename

* Say form not type in the Gradient Form node's doc comment
This commit is contained in:
Keavon Chambers
2026-08-04 05:51:10 -07:00
committed by Dennis Kobert
parent d5e31c23bb
commit b9a8065eb8
20 changed files with 174 additions and 191 deletions

View File

@@ -167,15 +167,7 @@ macro_rules! tagged_value {
Self::DashPattern(lengths) => Box::new(DashPattern::from(lengths)),
Self::BoxCorners(values) => Box::new(BoxCorners::from(values)),
Self::Color(color) => Box::new(List::<Color>::new_from_element(color)),
Self::GradientRamp(ramp) => {
// The ramp's gradient spread rides the served list as its attribute, as `Item<Gradient>::from` does on master.
let gradient_spread = ramp.gradient_spread;
let mut list = List::<Gradient>::new_from_element(Gradient::from(ramp));
if !gradient_spread.is_default() {
list.set_attribute(graphic_types::vector_types::ATTR_GRADIENT_SPREAD, 0, gradient_spread);
}
Box::new(list)
}
Self::GradientRamp(ramp) => Box::new(List::new_from_item(core_types::list::Item::<Gradient>::from(ramp))),
Self::BrushStrokes(strokes) => {
let list: List<BrushStroke> = strokes.into_iter().map(core_types::list::Item::new_from_element).collect();
Box::new(list)
@@ -221,15 +213,7 @@ macro_rules! tagged_value {
Self::DashPattern(lengths) => Arc::new(DashPattern::from(lengths)),
Self::BoxCorners(values) => Arc::new(BoxCorners::from(values)),
Self::Color(color) => Arc::new(List::<Color>::new_from_element(color)),
Self::GradientRamp(ramp) => {
// The ramp's gradient spread rides the served list as its attribute, as `Item<Gradient>::from` does on master.
let gradient_spread = ramp.gradient_spread;
let mut list = List::<Gradient>::new_from_element(Gradient::from(ramp));
if !gradient_spread.is_default() {
list.set_attribute(graphic_types::vector_types::ATTR_GRADIENT_SPREAD, 0, gradient_spread);
}
Arc::new(list)
}
Self::GradientRamp(ramp) => Arc::new(List::new_from_item(core_types::list::Item::<Gradient>::from(ramp))),
Self::BrushStrokes(strokes) => {
let list: List<BrushStroke> = strokes.into_iter().map(core_types::list::Item::new_from_element).collect();
Arc::new(list)
@@ -626,7 +610,8 @@ tagged_value! {
StrokeJoin(vector::style::StrokeJoin),
StrokeAlign(vector::style::StrokeAlign),
PaintOrder(vector::style::PaintOrder),
GradientType(vector::style::GradientType),
#[serde(alias = "GradientType")] // TODO: Eventually remove this document upgrade code
GradientForm(vector::style::GradientForm),
#[serde(alias = "GradientSpreadMethod")] // TODO: Eventually remove this document upgrade code
GradientSpread(vector::style::GradientSpread),
ReferencePoint(vector::ReferencePoint),