@@ -2451,35 +2451,29 @@ pub(crate) fn fill_properties(node_id: NodeId, context: &mut NodePropertiesConte
24512451 widgets_first_row. push (
24522452 ColorInput :: default ( )
24532453 . value ( FillChoiceUI :: from ( & FillChoice :: from ( fill. clone ( ) ) ) )
2454- . on_update ( move |x : & ColorInput | Message :: Batched {
2455- messages : Box :: new ( [
2456- match & fill2 {
2457- Fill :: None => NodeGraphMessage :: SetInputValue {
2458- node_id ,
2459- input_index : BackupColorInput :: INDEX ,
2460- value : TaggedValue :: Color ( None ) ,
2461- }
2462- . into ( ) ,
2463- Fill :: Solid ( color ) => NodeGraphMessage :: SetInputValue {
2454+ . on_update ( move |x : & ColorInput | {
2455+ let new_fill = FillChoice :: from ( & x . value ) . to_fill ( fill2 . as_gradient ( ) ) ;
2456+ let ( backup_index , backup_value ) = match & new_fill {
2457+ Fill :: None => ( BackupColorInput :: INDEX , TaggedValue :: Color ( None ) ) ,
2458+ Fill :: Solid ( color ) => ( BackupColorInput :: INDEX , TaggedValue :: Color ( Some ( * color ) ) ) ,
2459+ Fill :: Gradient ( gradient ) => ( BackupGradientInput :: INDEX , TaggedValue :: FillGradient ( gradient . clone ( ) ) ) ,
2460+ } ;
2461+ Message :: Batched {
2462+ messages : Box :: new ( [
2463+ NodeGraphMessage :: SetInputValue {
24642464 node_id,
2465- input_index : BackupColorInput :: INDEX ,
2466- value : TaggedValue :: Color ( Some ( * color ) ) ,
2465+ input_index : backup_index ,
2466+ value : backup_value ,
24672467 }
24682468 . into ( ) ,
2469- Fill :: Gradient ( gradient ) => NodeGraphMessage :: SetInputValue {
2469+ NodeGraphMessage :: SetInputValue {
24702470 node_id,
2471- input_index : BackupGradientInput :: INDEX ,
2472- value : TaggedValue :: FillGradient ( gradient . clone ( ) ) ,
2471+ input_index : FillInput :: < Color > :: INDEX ,
2472+ value : TaggedValue :: Fill ( new_fill ) ,
24732473 }
24742474 . into ( ) ,
2475- } ,
2476- NodeGraphMessage :: SetInputValue {
2477- node_id,
2478- input_index : FillInput :: < Color > :: INDEX ,
2479- value : TaggedValue :: Fill ( FillChoice :: from ( & x. value ) . to_fill ( fill2. as_gradient ( ) ) ) ,
2480- }
2481- . into ( ) ,
2482- ] ) ,
2475+ ] ) ,
2476+ }
24832477 } )
24842478 . on_commit ( commit_value)
24852479 . widget_instance ( ) ,
0 commit comments