@@ -10,7 +10,7 @@ use crate::messages::portfolio::document::utility_types::network_interface::Node
10
10
use crate :: messages:: preferences:: SelectionMode ;
11
11
use crate :: messages:: tool:: common_functionality:: auto_panning:: AutoPanning ;
12
12
use crate :: messages:: tool:: common_functionality:: shape_editor:: {
13
- ClosestSegment , ManipulatorAngle , OpposingHandleLengths , SelectedPointsInfo , SelectionChange , SelectionShape , SelectionShapeType , ShapeState ,
13
+ ClosestSegment , ManipulatorAngle , ManipulatorPointInfo , OpposingHandleLengths , SelectedPointsInfo , SelectionChange , SelectionShape , SelectionShapeType , ShapeState ,
14
14
} ;
15
15
use crate :: messages:: tool:: common_functionality:: snapping:: { SnapCache , SnapCandidatePoint , SnapConstraint , SnapData , SnapManager } ;
16
16
@@ -479,7 +479,37 @@ impl PathToolData {
479
479
self . drag_start_pos = input. mouse . position ;
480
480
481
481
let old_selection = shape_editor. selected_points ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
482
+ // Check if clicking on an already selected point
483
+ if let Some ( ( layer, nearest_point) ) = shape_editor. find_nearest_point_indices ( & document. network_interface , input. mouse . position , SELECTION_THRESHOLD ) {
484
+ let clicked_selected = shape_editor. selected_points ( ) . any ( |& point| nearest_point == point) ;
482
485
486
+ // If clicking on an already selected point, don't change selection
487
+ // Instead, start dragging immediately
488
+ if clicked_selected {
489
+ responses. add ( DocumentMessage :: StartTransaction ) ;
490
+
491
+ // Get the vector data for the current layer
492
+ let vector_data = document. network_interface . compute_modified_vector ( layer) . unwrap ( ) ;
493
+
494
+ // Create a SelectedPointsInfo with all currently selected points
495
+ let points = shape_editor
496
+ . selected_shape_state
497
+ . iter ( )
498
+ . flat_map ( |( layer, state) | state. selected ( ) . map ( |point_id| ManipulatorPointInfo { layer : * layer, point_id } ) )
499
+ . collect ( ) ;
500
+
501
+ // Offset is distance between point and cursor ( in this case it is zero )
502
+ let offset = DVec2 { x : 0.0 , y : 0.0 } ;
503
+
504
+ let selected_points = SelectedPointsInfo { points, offset, vector_data } ;
505
+
506
+ // Start dragging without changing selection
507
+ self . start_dragging_point ( selected_points, input, document, shape_editor) ;
508
+ responses. add ( OverlaysMessage :: Draw ) ;
509
+
510
+ return PathToolFsmState :: Dragging ( self . dragging_state ) ;
511
+ }
512
+ }
483
513
// Select the first point within the threshold (in pixels)
484
514
if let Some ( selected_points) = shape_editor. change_point_selection ( & document. network_interface , input. mouse . position , SELECTION_THRESHOLD , extend_selection) {
485
515
responses. add ( DocumentMessage :: StartTransaction ) ;
0 commit comments