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 10:15:56 +03:00
committed by GitHub
parent ddb2d744d4
commit 66a297df2c
6 changed files with 202 additions and 113 deletions

View File

@@ -67,7 +67,7 @@ impl Rect {
Self::from_box([self[0] - delta, self[1] + delta])
}
/// Expand a rect by a certain amount on top/bottom and on left/right
/// Checks if two rects intersect
#[must_use]
pub fn intersects(&self, other: Self) -> bool {
let [mina, maxa] = [self[0].min(self[1]), self[0].max(self[1])];