on xenial help sign in
fix off by one error in the corners
commit5d291b2c5895e956a9e5bfaad60ebcf93c8a5c53 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 26 Aug 2016, 16:44 (10 years ago) parent4db8944
1 file changed+3−3
plugins/Cursor/MousePointer.cpp+3−3
plugins/Cursor/MousePointer.cpp+3−3
@@ -58,13 +58,13 @@ void MousePointer::handleMouseEvent(ulong timestamp, QPointF movement, Qt::Mouse
5858 if (newX < 0 && newY < m_panelHeight) { // top left corner
5959 const auto distance = qSqrt(qPow(newX, 2) + qPow(newY-m_panelHeight, 2));
6060 Q_EMIT pushedTopLeftCorner(qAbs(distance), buttons);
61− } else if (newX >= sceneWidth && newY < m_panelHeight) { // top right corner
61+ } else if (newX >= sceneWidth-1 && newY < m_panelHeight) { // top right corner
6262 const auto distance = qSqrt(qPow(newX-sceneWidth, 2) + qPow(newY-m_panelHeight, 2));
6363 Q_EMIT pushedTopRightCorner(qAbs(distance), buttons);
64− } else if (newX < 0 && newY >= sceneHeight) { // bottom left corner
64+ } else if (newX < 0 && newY >= sceneHeight-1) { // bottom left corner
6565 const auto distance = qSqrt(qPow(newX, 2) + qPow(newY-sceneHeight, 2));
6666 Q_EMIT pushedBottomLeftCorner(qAbs(distance), buttons);
67− } else if (newX >= sceneWidth && newY >= sceneHeight) { // bottom right corner
67+ } else if (newX >= sceneWidth-1 && newY >= sceneHeight-1) { // bottom right corner
6868 const auto distance = qSqrt(qPow(newX-sceneWidth, 2) + qPow(newY-sceneHeight, 2));
6969 Q_EMIT pushedBottomRightCorner(qAbs(distance), buttons);
7070 } else if (newX < 0) { // left edge