mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 06:18:12 +08:00
Wrap serialized gradient stops in a new GradientRamp struct and unify FillChoice (#4400)
* Introduce the GradientRamp exchange struct as the serialized TaggedValue::Gradient payload * Unify FillChoice and FillChoiceUI into one enum generic over color format, carrying GradientRamp stops * Rename the TaggedValue::Gradient variant to GradientRamp to match its payload * Move the Color variant into the tagged_value macro list since its stored and wire forms match
This commit is contained in:
@@ -1673,7 +1673,7 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
|
||||
let fill_value = match old_fill {
|
||||
graphic_types::migrations::legacy::LegacyFill::None => TaggedValue::no_paint(),
|
||||
graphic_types::migrations::legacy::LegacyFill::Solid(color) => TaggedValue::Color(*color),
|
||||
graphic_types::migrations::legacy::LegacyFill::Gradient(gradient) => TaggedValue::Gradient(gradient.stops.clone()),
|
||||
graphic_types::migrations::legacy::LegacyFill::Gradient(gradient) => TaggedValue::GradientRamp(gradient.stops.clone()),
|
||||
};
|
||||
document
|
||||
.network_interface
|
||||
@@ -1721,7 +1721,7 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
|
||||
if let Some(TaggedValue::LegacyGradient(g)) = old_inputs[3].as_value() {
|
||||
document.network_interface.set_input(
|
||||
&InputConnector::node_at_index(*node_id, 3),
|
||||
NodeInput::value(TaggedValue::Gradient(g.stops.clone()), false),
|
||||
NodeInput::value(TaggedValue::GradientRamp(g.stops.clone()), false),
|
||||
network_path,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user