@@ -25,6 +25,7 @@ use graph_craft::document::value::TaggedValue;
2525use graph_craft:: document:: { DocumentNodeImplementation , NodeId , NodeInput } ;
2626use graph_craft:: proto:: GraphErrors ;
2727use graphene_std:: math:: math_ext:: QuadExt ;
28+ use graphene_std:: vector:: VectorModification ;
2829use graphene_std:: vector:: misc:: subpath_to_kurbo_bezpath;
2930use graphene_std:: * ;
3031use kurbo:: { Line , Point } ;
@@ -145,9 +146,17 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
145146 if first_layer. is_some ( ) && has_single_selection && is_compatible {
146147 if let Some ( layer) = first_layer {
147148 let node_type = "Path" . to_string ( ) ;
148- let graph_layer = graph_modification_utils:: NodeGraphLayer :: new ( layer, & network_interface) ;
149- let is_modifiable = matches ! ( graph_layer. find_input( "Path" , 1 ) , Some ( TaggedValue :: VectorModification ( _) ) ) ;
150- if !is_modifiable {
149+ let path_node_with_no_diffs_exist = first_layer. is_some_and ( |layer| {
150+ let graph_layer = graph_modification_utils:: NodeGraphLayer :: new ( layer, & network_interface) ;
151+ if let Some ( TaggedValue :: VectorModification ( vector) ) = graph_layer. find_input ( "Path" , 1 ) {
152+ let modification = * vector. clone ( ) ;
153+ modification == VectorModification :: default ( )
154+ } else {
155+ false
156+ }
157+ } ) ;
158+
159+ if !path_node_with_no_diffs_exist {
151160 responses. add ( NodeGraphMessage :: CreateNodeInLayerWithTransaction {
152161 node_type : node_type. clone ( ) ,
153162 layer : LayerNodeIdentifier :: new_unchecked ( layer. to_node ( ) ) ,
0 commit comments