aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/layout/IHyprLayout.cpp
diff options
context:
space:
mode:
authorMike Will <[email protected]>2024-12-06 09:25:14 -0500
committerGitHub <[email protected]>2024-12-06 15:25:14 +0100
commit5ff02902ee830d29ededdb790ed5c8ef7aa111ed (patch)
treeb07dcc88a0ad4a544f84d96b205d21da71838e30 /src/layout/IHyprLayout.cpp
parentcccca7c02e0846eb4386dc26bb2d99f921c6114e (diff)
downloadHyprland-5ff02902ee830d29ededdb790ed5c8ef7aa111ed.tar.gz
Hyprland-5ff02902ee830d29ededdb790ed5c8ef7aa111ed.zip
snap: use the bit mask to check if snapping occurred (#8659)
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
-rw-r--r--src/layout/IHyprLayout.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index cb1f064b..1f305555 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -455,7 +455,7 @@ static void performSnap(Vector2D& sourcePos, Vector2D& sourceSize, PHLWINDOW DRA
// corner snapping
const double BORDERDIFF = OTHERBORDERSIZE - DRAGGINGBORDERSIZE;
- if (sourceX.start == SURFBX.end || SURFBX.start == sourceX.end) {
+ if (snaps & (SNAP_LEFT | SNAP_RIGHT)) {
const SRange SURFY = {SURF.y - BORDERDIFF, SURF.y + SURF.h + BORDERDIFF};
if (CORNER & (CORNER_TOPLEFT | CORNER_TOPRIGHT) && canSnap(sourceY.start, SURFY.start, GAPSIZE)) {
SNAP(sourceY.start, sourceY.end, SURFY.start);
@@ -465,7 +465,7 @@ static void performSnap(Vector2D& sourcePos, Vector2D& sourceSize, PHLWINDOW DRA
snaps |= SNAP_DOWN;
}
}
- if (sourceY.start == SURFBY.end || SURFBY.start == sourceY.end) {
+ if (snaps & (SNAP_UP | SNAP_DOWN)) {
const SRange SURFX = {SURF.x - BORDERDIFF, SURF.x + SURF.w + BORDERDIFF};
if (CORNER & (CORNER_TOPLEFT | CORNER_BOTTOMLEFT) && canSnap(sourceX.start, SURFX.start, GAPSIZE)) {
SNAP(sourceX.start, sourceX.end, SURFX.start);