@@ -421,15 +421,12 @@ impl ShapeState {
421421 ( point. as_handle ( ) . is_some ( ) && self . ignore_handles ) || ( point. as_anchor ( ) . is_some ( ) && self . ignore_anchors )
422422 }
423423
424- /// Creates a dummy segment insertion to trigger graph reorganization.
425- /// This dummy segment will fail to insert (because PointIds become invalid during execution),
426- /// but the important side effect is that it triggers the reorganization we need.
427- fn create_dummy_segment_to_trigger_graph_reorganization ( layer : LayerNodeIdentifier , start_point : PointId , end_point : PointId , responses : & mut VecDeque < Message > ) {
428- let dummy_segment_id = SegmentId :: generate ( ) ;
429- let dummy_modification = VectorModificationType :: InsertSegment {
430- id : dummy_segment_id,
431- points : [ start_point, end_point] ,
432- handles : [ None , None ] ,
424+ /// Creates a dummy modification to trigger graph reorganization.
425+ fn add_dummy_modification_to_trigger_graph_reorganization ( layer : LayerNodeIdentifier , start_point : PointId , _end_point : PointId , responses : & mut VecDeque < Message > ) {
426+ // Apply a zero-delta to one of the points to trigger reorganization
427+ let dummy_modification = VectorModificationType :: ApplyPointDelta {
428+ point : start_point,
429+ delta : DVec2 :: ZERO ,
433430 } ;
434431 responses. add ( GraphOperationMessage :: Vector {
435432 layer,
@@ -452,8 +449,8 @@ impl ShapeState {
452449 let start_pos = layer_transform. transform_point2 ( start_local) ;
453450 let end_pos = layer_transform. transform_point2 ( end_local) ;
454451
455- // This segment insertion will fail, but causes point domain reorganization
456- Self :: create_dummy_segment_to_trigger_graph_reorganization ( layer, start_point, end_point, responses) ;
452+ // This zero-delta modification triggers point domain reorganization
453+ Self :: add_dummy_modification_to_trigger_graph_reorganization ( layer, start_point, end_point, responses) ;
457454
458455 // Defer position-based connection to run after reorganization completes
459456 // By then, PointIds will be stable with their new remapped values
0 commit comments