@@ -99,6 +99,7 @@ impl SnappingState {
9999 PathSnapTarget :: NormalToPath => self . path . normal_to_path ,
100100 PathSnapTarget :: TangentToPath => self . path . tangent_to_path ,
101101 PathSnapTarget :: IntersectionPoint => self . path . path_intersection_point ,
102+ PathSnapTarget :: PerpendicularToEndpoint => self . path . perpendicular_from_endpoint ,
102103 } ,
103104 SnapTarget :: Artboard ( _) => self . artboards ,
104105 SnapTarget :: Grid ( _) => self . grid_snapping ,
@@ -142,6 +143,7 @@ pub struct PathSnapping {
142143 pub tangent_to_path : bool ,
143144 pub path_intersection_point : bool ,
144145 pub align_with_anchor_point : bool , // TODO: Rename
146+ pub perpendicular_from_endpoint : bool ,
145147}
146148
147149impl Default for PathSnapping {
@@ -154,6 +156,7 @@ impl Default for PathSnapping {
154156 tangent_to_path : true ,
155157 path_intersection_point : true ,
156158 align_with_anchor_point : true ,
159+ perpendicular_from_endpoint : true ,
157160 }
158161 }
159162}
@@ -476,6 +479,7 @@ pub enum PathSnapTarget {
476479 NormalToPath ,
477480 TangentToPath ,
478481 IntersectionPoint ,
482+ PerpendicularToEndpoint ,
479483}
480484
481485impl fmt:: Display for PathSnapTarget {
@@ -487,6 +491,7 @@ impl fmt::Display for PathSnapTarget {
487491 PathSnapTarget :: NormalToPath => write ! ( f, "Path: Normal to Path" ) ,
488492 PathSnapTarget :: TangentToPath => write ! ( f, "Path: Tangent to Path" ) ,
489493 PathSnapTarget :: IntersectionPoint => write ! ( f, "Path: Intersection Point" ) ,
494+ PathSnapTarget :: PerpendicularToEndpoint => write ! ( f, "Path: Perp. to Endpoint" ) ,
490495 }
491496 }
492497}
@@ -533,6 +538,7 @@ pub enum AlignmentSnapTarget {
533538 ArtboardCenterPoint ,
534539 AlignWithAnchorPoint ,
535540 IntersectionPoint ,
541+ PerpendicularToEndpoint ,
536542}
537543
538544impl fmt:: Display for AlignmentSnapTarget {
@@ -544,6 +550,7 @@ impl fmt::Display for AlignmentSnapTarget {
544550 AlignmentSnapTarget :: ArtboardCenterPoint => write ! ( f, "{}" , ArtboardSnapTarget :: CenterPoint ) ,
545551 AlignmentSnapTarget :: AlignWithAnchorPoint => write ! ( f, "{}" , PathSnapTarget :: AnchorPointWithColinearHandles ) ,
546552 AlignmentSnapTarget :: IntersectionPoint => write ! ( f, "{}" , PathSnapTarget :: IntersectionPoint ) ,
553+ AlignmentSnapTarget :: PerpendicularToEndpoint => write ! ( f, "{}" , PathSnapTarget :: PerpendicularToEndpoint ) ,
547554 }
548555 }
549556}
0 commit comments