@@ -99,6 +99,7 @@ impl SnappingState {
99
99
PathSnapTarget :: NormalToPath => self . path . normal_to_path ,
100
100
PathSnapTarget :: TangentToPath => self . path . tangent_to_path ,
101
101
PathSnapTarget :: IntersectionPoint => self . path . path_intersection_point ,
102
+ PathSnapTarget :: PerpendicularToEndpoint => self . path . perpendicular_from_endpoint ,
102
103
} ,
103
104
SnapTarget :: Artboard ( _) => self . artboards ,
104
105
SnapTarget :: Grid ( _) => self . grid_snapping ,
@@ -142,6 +143,7 @@ pub struct PathSnapping {
142
143
pub tangent_to_path : bool ,
143
144
pub path_intersection_point : bool ,
144
145
pub align_with_anchor_point : bool , // TODO: Rename
146
+ pub perpendicular_from_endpoint : bool ,
145
147
}
146
148
147
149
impl Default for PathSnapping {
@@ -154,6 +156,7 @@ impl Default for PathSnapping {
154
156
tangent_to_path : true ,
155
157
path_intersection_point : true ,
156
158
align_with_anchor_point : true ,
159
+ perpendicular_from_endpoint : true ,
157
160
}
158
161
}
159
162
}
@@ -476,6 +479,7 @@ pub enum PathSnapTarget {
476
479
NormalToPath ,
477
480
TangentToPath ,
478
481
IntersectionPoint ,
482
+ PerpendicularToEndpoint ,
479
483
}
480
484
481
485
impl fmt:: Display for PathSnapTarget {
@@ -487,6 +491,7 @@ impl fmt::Display for PathSnapTarget {
487
491
PathSnapTarget :: NormalToPath => write ! ( f, "Path: Normal to Path" ) ,
488
492
PathSnapTarget :: TangentToPath => write ! ( f, "Path: Tangent to Path" ) ,
489
493
PathSnapTarget :: IntersectionPoint => write ! ( f, "Path: Intersection Point" ) ,
494
+ PathSnapTarget :: PerpendicularToEndpoint => write ! ( f, "Path: Perp. to Endpoint" ) ,
490
495
}
491
496
}
492
497
}
@@ -533,6 +538,7 @@ pub enum AlignmentSnapTarget {
533
538
ArtboardCenterPoint ,
534
539
AlignWithAnchorPoint ,
535
540
IntersectionPoint ,
541
+ PerpendicularToEndpoint ,
536
542
}
537
543
538
544
impl fmt:: Display for AlignmentSnapTarget {
@@ -544,6 +550,7 @@ impl fmt::Display for AlignmentSnapTarget {
544
550
AlignmentSnapTarget :: ArtboardCenterPoint => write ! ( f, "{}" , ArtboardSnapTarget :: CenterPoint ) ,
545
551
AlignmentSnapTarget :: AlignWithAnchorPoint => write ! ( f, "{}" , PathSnapTarget :: AnchorPointWithColinearHandles ) ,
546
552
AlignmentSnapTarget :: IntersectionPoint => write ! ( f, "{}" , PathSnapTarget :: IntersectionPoint ) ,
553
+ AlignmentSnapTarget :: PerpendicularToEndpoint => write ! ( f, "{}" , PathSnapTarget :: PerpendicularToEndpoint ) ,
547
554
}
548
555
}
549
556
}
0 commit comments