@@ -1,5 +1,5 @@
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
4 * This program is free software: you can redistribute it and/or modify it under
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
5 * the terms of the GNU Lesser General Public License version 3, as published by
@@ -43,7 +43,12 @@ void MousePointer::handleMouseEvent(ulong timestamp, QPointF movement, Qt::Mouse
43 Q_EMIT mouseMoved();
43 Q_EMIT mouseMoved();
46+ m_accumulatedMovement += movement;
47+ // don't apply the fractional part
48+ QPointF appliedMovement(int(m_accumulatedMovement.x()), int(m_accumulatedMovement.y()));
49+ m_accumulatedMovement -= appliedMovement;
46− qreal newX = x() + movement.x();
51+ qreal newX = x() + appliedMovement.x();
47 if (newX < 0) {
52 if (newX < 0) {
48 Q_EMIT pushedLeftBoundary(qAbs(newX), buttons);
53 Q_EMIT pushedLeftBoundary(qAbs(newX), buttons);
@@ -53,7 +58,7 @@ void MousePointer::handleMouseEvent(ulong timestamp, QPointF movement, Qt::Mouse
54 setX(newX);
59 setX(newX);
56− qreal newY = y() + movement.y();
61+ qreal newY = y() + appliedMovement.y();
57 if (newY < 0) {
62 if (newY < 0) {
59 } else if (newY > parentItem()->height()) {
64 } else if (newY > parentItem()->height()) {