Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Keavon committed Jan 13, 2025
1 parent 8288356 commit e851aa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub const SNAP_FUNCTIONS_FOR_BOUNDING_BOXES: [(&str, GetSnapState, &str); 5] = [
(
"Align with Edges",
(|snapping_state| &mut snapping_state.bounding_box.align_with_edges) as GetSnapState,
"Snaps to horizontal/vertical alignment with the edges of any layer's bounding box"
"Snaps to horizontal/vertical alignment with the edges of any layer's bounding box",
),
(
"Corner Points",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,9 @@ impl AlignmentSnapper {
Quad::intersect_rays(target_point.document_point, DVec2::X, origin, direction),
]
} else {
let Some(quad) = target_point.quad else {
continue;
};
let quad = quad.0;
let Some(quad) = target_point.quad.map(|quad| quad.0) else { continue };
let edges = [quad[1] - quad[0], quad[3] - quad[0]];
edges
.map(|edge| edge.try_normalize().map(|edge| (point.document_point - target_position).project_onto(edge) + target_position))
.into()
edges.map(|edge| edge.try_normalize().map(|edge| (point.document_point - target_position).project_onto(edge) + target_position))
};

let target_path = matches!(target_point.target, SnapTarget::Path(_));
Expand Down

0 comments on commit e851aa4

Please sign in to comment.