Improve the distribution part of the snapping system (#2626)

* fix distribution snapper visualization going far from layers

* fix bugs

* Remove traces

* remove comment

* Fix tests

* Rename distribution snapper variables from x, y to horizontal, vertical

* Fix tests

* Fix bug where center point and corner point have to be enabled for distribution_snapper to work

* Cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Mohamed Osama
2025-05-20 00:15:56 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent ddb2d744d4
commit 66a297df2c
6 changed files with 202 additions and 113 deletions
@@ -404,8 +404,7 @@ pub const SNAP_FUNCTIONS_FOR_BOUNDING_BOXES: [(&str, GetSnapState, &str); 5] = [
(
"Distribute Evenly",
(|snapping_state| &mut snapping_state.bounding_box.distribute_evenly) as GetSnapState,
// TODO: Fix the bug/limitation that requires 'Center Points' and 'Corner Points' to be enabled
"Snaps to a consistent distance offset established by the bounding boxes of nearby layers\n(due to a bug, 'Center Points' and 'Corner Points' must be enabled)",
"Snaps to a consistent distance offset established by the bounding boxes of nearby layers",
),
];
pub const SNAP_FUNCTIONS_FOR_PATHS: [(&str, GetSnapState, &str); 7] = [