From 0707bd5183c7852b0610890b4d663d0bfa81df3c Mon Sep 17 00:00:00 2001 From: Annonnymmousss Date: Mon, 18 May 2026 16:10:31 +0530 Subject: [PATCH 1/2] fix: Fill node solid colour backup update --- .../document/node_graph/node_properties.rs | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 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 a58576c408..82478d2034 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_properties.rs @@ -2483,35 +2483,38 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte widgets_first_row.push( ColorInput::default() .value(FillChoiceUI::from(&FillChoice::from(fill.clone()))) - .on_update(move |x: &ColorInput| Message::Batched { - messages: Box::new([ - match &fill2 { - Fill::None => NodeGraphMessage::SetInputValue { - node_id, - input_index: BackupColorInput::INDEX, - value: TaggedValue::Color(None), - } - .into(), - Fill::Solid(color) => NodeGraphMessage::SetInputValue { - node_id, - input_index: BackupColorInput::INDEX, - value: TaggedValue::Color(Some(*color)), - } - .into(), - Fill::Gradient(gradient) => NodeGraphMessage::SetInputValue { + .on_update(move |x: &ColorInput| { + let new_fill = FillChoice::from(&x.value).to_fill(fill2.as_gradient()); + Message::Batched { + messages: Box::new([ + match &new_fill { + Fill::None => NodeGraphMessage::SetInputValue { + node_id, + input_index: BackupColorInput::INDEX, + value: TaggedValue::Color(None), + } + .into(), + Fill::Solid(color) => NodeGraphMessage::SetInputValue { + node_id, + input_index: BackupColorInput::INDEX, + value: TaggedValue::Color(Some(*color)), + } + .into(), + Fill::Gradient(gradient) => NodeGraphMessage::SetInputValue { + node_id, + input_index: BackupGradientInput::INDEX, + value: TaggedValue::FillGradient(gradient.clone()), + } + .into(), + }, + NodeGraphMessage::SetInputValue { node_id, - input_index: BackupGradientInput::INDEX, - value: TaggedValue::FillGradient(gradient.clone()), + input_index: FillInput::::INDEX, + value: TaggedValue::Fill(new_fill), } .into(), - }, - NodeGraphMessage::SetInputValue { - node_id, - input_index: FillInput::::INDEX, - value: TaggedValue::Fill(FillChoice::from(&x.value).to_fill(fill2.as_gradient())), - } - .into(), - ]), + ]), + } }) .on_commit(commit_value) .widget_instance(), From f34b995fb91295e2938bf25e7459a72585e902d5 Mon Sep 17 00:00:00 2001 From: Annonnymmousss Date: Mon, 18 May 2026 16:34:52 +0530 Subject: [PATCH 2/2] chore: refactor --- .../document/node_graph/node_properties.rs | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 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 82478d2034..7110bb43d9 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_properties.rs @@ -2485,28 +2485,19 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte .value(FillChoiceUI::from(&FillChoice::from(fill.clone()))) .on_update(move |x: &ColorInput| { let new_fill = FillChoice::from(&x.value).to_fill(fill2.as_gradient()); + let (backup_index, backup_value) = match &new_fill { + Fill::None => (BackupColorInput::INDEX, TaggedValue::Color(None)), + Fill::Solid(color) => (BackupColorInput::INDEX, TaggedValue::Color(Some(*color))), + Fill::Gradient(gradient) => (BackupGradientInput::INDEX, TaggedValue::FillGradient(gradient.clone())), + }; Message::Batched { messages: Box::new([ - match &new_fill { - Fill::None => NodeGraphMessage::SetInputValue { - node_id, - input_index: BackupColorInput::INDEX, - value: TaggedValue::Color(None), - } - .into(), - Fill::Solid(color) => NodeGraphMessage::SetInputValue { - node_id, - input_index: BackupColorInput::INDEX, - value: TaggedValue::Color(Some(*color)), - } - .into(), - Fill::Gradient(gradient) => NodeGraphMessage::SetInputValue { - node_id, - input_index: BackupGradientInput::INDEX, - value: TaggedValue::FillGradient(gradient.clone()), - } - .into(), - }, + NodeGraphMessage::SetInputValue { + node_id, + input_index: backup_index, + value: backup_value, + } + .into(), NodeGraphMessage::SetInputValue { node_id, input_index: FillInput::::INDEX,