@@ -478,12 +478,17 @@ impl PathToolData {
478
478
return None ; // Do not allow selections of multiple points to count.
479
479
}
480
480
let selected_handle = selection. selected ( ) . next ( ) ?. as_handle ( ) ?; // Only count selected handles
481
+ let layer_to_document = document. metadata ( ) . transform_to_document ( * layer) ;
481
482
let vector_data = document. network_interface . compute_modified_vector ( * layer) ?;
482
- let handle_position = selected_handle. to_manipulator_point ( ) . get_position ( & vector_data) ?;
483
+
484
+ let handle_position_local = selected_handle. to_manipulator_point ( ) . get_position ( & vector_data) ?;
483
485
let anchor_id = selected_handle. to_manipulator_point ( ) . get_anchor ( & vector_data) ?;
484
- let anchor_position = vector_data. point_domain . position_from_id ( anchor_id) ?;
486
+ let anchor_position_local = vector_data. point_domain . position_from_id ( anchor_id) ?;
487
+
488
+ let handle_position_document = layer_to_document. transform_point2 ( handle_position_local) ;
489
+ let anchor_position_document = layer_to_document. transform_point2 ( anchor_position_local) ;
485
490
486
- Some ( ( handle_position , anchor_position ) )
491
+ Some ( ( handle_position_document , anchor_position_document ) )
487
492
}
488
493
489
494
fn calculate_handle_angle ( & mut self , handle_vector : DVec2 , lock_angle : bool , snap_angle : bool ) -> f64 {
@@ -516,7 +521,7 @@ impl PathToolData {
516
521
) -> DVec2 {
517
522
let snap_point = SnapCandidatePoint :: handle_neighbors ( new_handle_position, [ anchor_position] ) ;
518
523
519
- if using_angle_constraints {
524
+ document . metadata ( ) . document_to_viewport . transform_vector2 ( if using_angle_constraints {
520
525
let direction = handle_direction. normalize_or_zero ( ) ;
521
526
let snap_constraint = SnapConstraint :: Line { origin : anchor_position, direction } ;
522
527
let snap_result = self
@@ -529,7 +534,7 @@ impl PathToolData {
529
534
let snap_result = self . snap_manager . free_snap ( & SnapData :: new ( document, input) , & snap_point, SnapTypeConfiguration :: default ( ) ) ;
530
535
self . snap_manager . update_indicator ( snap_result. clone ( ) ) ;
531
536
snap_result. snapped_point_document - handle_position
532
- }
537
+ } )
533
538
}
534
539
535
540
fn drag (
@@ -557,7 +562,7 @@ impl PathToolData {
557
562
let constrained_target = anchor_pos + constrained_direction * projected_length;
558
563
let constrained_delta = constrained_target - handle_pos;
559
564
560
- self . apply_snapping ( constrained_direction, handle_pos + constrained_delta, anchor_pos, true , handle_pos, document, input)
565
+ self . apply_snapping ( constrained_direction, handle_pos + constrained_delta, anchor_pos, lock_angle || snap_angle , handle_pos, document, input)
561
566
} else {
562
567
shape_editor. snap ( & mut self . snap_manager , & self . snap_cache , document, input, previous_mouse)
563
568
} ;
0 commit comments