diff options
author | Vaxry <[email protected]> | 2023-11-07 20:47:09 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2023-11-07 20:47:09 +0000 |
commit | a0fcda301d4657db8eedcb88a348650fafab9896 (patch) | |
tree | db772088011af561b1e57da293ef503e5d80b5e9 | |
parent | 47654a84c2dc68d478d044fd0589ec5cc96dbc66 (diff) | |
download | Hyprland-a0fcda301d4657db8eedcb88a348650fafab9896.tar.gz Hyprland-a0fcda301d4657db8eedcb88a348650fafab9896.zip |
layout: round box in mouseMove
fixes #3792
-rw-r--r-- | src/layout/IHyprLayout.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 274acb13..c5ed1199 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -305,11 +305,13 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) { if (g_pInputManager->dragMode == MBIND_MOVE) { - if (*PANIMATEMOUSE) { - DRAGGINGWINDOW->m_vRealPosition = m_vBeginDragPositionXY + DELTA; - } else { - DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA); - } + CBox wb = {m_vBeginDragPositionXY + DELTA, DRAGGINGWINDOW->m_vRealSize.goalv()}; + wb.round(); + + if (*PANIMATEMOUSE) + DRAGGINGWINDOW->m_vRealPosition = wb.pos(); + else + DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(wb.pos()); g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv()); } else if (g_pInputManager->dragMode == MBIND_RESIZE || g_pInputManager->dragMode == MBIND_RESIZE_FORCE_RATIO || g_pInputManager->dragMode == MBIND_RESIZE_BLOCK_RATIO) { |