Fix "contrain" typo (#1717)

Fix typo 'contrain' to true 'constrain

Fix typo 'contrain' to true 'constrain'
This commit is contained in:
Muhammad Aqdas
2024-03-31 06:15:57 +00:00
committed by GitHub
parent 291c580924
commit e22db31738
4 changed files with 20 additions and 20 deletions
@@ -113,7 +113,7 @@ fn get_closest_intersection(snap_to: DVec2, curves: &[SnappedCurve]) -> Option<S
curves: [Some(close.document_curve), Some(far.document_curve)],
source: close.point.source,
at_intersection: true,
contrained: true,
constrained: true,
..Default::default()
})
}
@@ -136,7 +136,7 @@ fn get_grid_intersection(snap_to: DVec2, lines: &[SnappedLine]) -> Option<Snappe
tolerance: line_i.point.tolerance,
source: line_i.point.source,
at_intersection: true,
contrained: true,
constrained: true,
..Default::default()
})
}
@@ -189,7 +189,7 @@ impl SnapManager {
self.update_indicator(snapped);
}
fn find_best_snap(snap_data: &mut SnapData, point: &SnapCandidatePoint, snap_results: SnapResults, contrained: bool, off_screen: bool, to_path: bool) -> SnappedPoint {
fn find_best_snap(snap_data: &mut SnapData, point: &SnapCandidatePoint, snap_results: SnapResults, constrained: bool, off_screen: bool, to_path: bool) -> SnappedPoint {
let mut snapped_points = Vec::new();
let document = snap_data.document;
@@ -207,7 +207,7 @@ impl SnapManager {
}
}
if !contrained {
if !constrained {
if document.snapping_state.target_enabled(SnapTarget::Geometry(GeometrySnapTarget::Intersection)) {
if let Some(closest_curves_intersection) = get_closest_intersection(point.document_point, &snap_results.curves) {
snapped_points.push(closest_curves_intersection);
@@ -316,8 +316,8 @@ impl SnapManager {
let mut snap_data = snap_data.clone();
snap_data.candidates = Some(&*self.candidates.get_or_insert_with(|| Self::find_candidates(&snap_data, point, bbox)));
self.layer_snapper.contrained_snap(&mut snap_data, point, &mut snap_results, constraint);
self.grid_snapper.contrained_snap(&mut snap_data, point, &mut snap_results, constraint);
self.layer_snapper.constrained_snap(&mut snap_data, point, &mut snap_results, constraint);
self.grid_snapper.constrained_snap(&mut snap_data, point, &mut snap_results, constraint);
Self::find_best_snap(&mut snap_data, point, snap_results, true, false, false)
}