From b2813c56a6cc441b7eb816861294a7acb094da64 Mon Sep 17 00:00:00 2001 From: Ziad Ashraf Date: Thu, 19 Mar 2026 21:52:31 +0200 Subject: [PATCH 1/2] FIX: fixed the color picker bug --- .../document/node_graph/node_properties.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/editor/src/messages/portfolio/document/node_graph/node_properties.rs b/editor/src/messages/portfolio/document/node_graph/node_properties.rs index 482d67f78d..320d682a14 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_properties.rs @@ -1837,6 +1837,7 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte return vec![LayoutGroup::row(widgets_first_row)]; }; let fill2 = fill.clone(); + let backup_gradient2 = backup_gradient.clone(); let backup_color_fill: Fill = backup_color.clone().into(); let backup_gradient_fill: Fill = backup_gradient.clone().into(); @@ -1846,23 +1847,28 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte .value(fill.clone().into()) .on_update(move |x: &ColorInput| Message::Batched { messages: Box::new([ - match &fill2 { - Fill::None => NodeGraphMessage::SetInputValue { + // Put the new and most up to date colour into the backup slot (to avoid out of date backup slot) + match &x.value { + FillChoice::None => NodeGraphMessage::SetInputValue { node_id, input_index: BackupColorInput::INDEX, value: TaggedValue::Color(Table::new()), } .into(), - Fill::Solid(color) => NodeGraphMessage::SetInputValue { + FillChoice::Solid(color) => NodeGraphMessage::SetInputValue { node_id, input_index: BackupColorInput::INDEX, value: TaggedValue::Color(Table::new_from_element(*color)), } .into(), - Fill::Gradient(gradient) => NodeGraphMessage::SetInputValue { + FillChoice::Gradient(gradient) => NodeGraphMessage::SetInputValue { node_id, input_index: BackupGradientInput::INDEX, - value: TaggedValue::Gradient(gradient.clone()), + value: { + let mut backup_gradient_new = backup_gradient2.clone(); + backup_gradient_new.stops = gradient.clone(); + TaggedValue::Gradient(backup_gradient_new) + }, } .into(), }, From 9393d47b370bcd192a23ef2ca1edcbe3bf033df5 Mon Sep 17 00:00:00 2001 From: Ziad Ashraf Date: Thu, 19 Mar 2026 22:50:24 +0200 Subject: [PATCH 2/2] Fix gradient type/orientation metadata preservation in backup --- .../messages/portfolio/document/node_graph/node_properties.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/src/messages/portfolio/document/node_graph/node_properties.rs b/editor/src/messages/portfolio/document/node_graph/node_properties.rs index 320d682a14..396abe5b31 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_properties.rs @@ -1865,7 +1865,7 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte node_id, input_index: BackupGradientInput::INDEX, value: { - let mut backup_gradient_new = backup_gradient2.clone(); + let mut backup_gradient_new = fill2.as_gradient().cloned().unwrap_or_else(|| backup_gradient2.clone()); backup_gradient_new.stops = gradient.clone(); TaggedValue::Gradient(backup_gradient_new) },