map the mose movement to the rotation part of the applet transform

svn path=/trunk/KDE/kdelibs/; revision=1021964
This commit is contained in:
Marco Martin 2009-09-10 11:45:19 +00:00
parent c89700f775
commit 842e0349a6

View File

@ -1565,7 +1565,10 @@ void Applet::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
// our direct parent is a containment. just move ourselves.
QPointF curPos = event->pos();
QPointF lastPos = event->lastPos();
QPointF delta = curPos - lastPos;
QTransform appletTransform = transform();
//we need to discard translation from the transform
QTransform t(appletTransform.m11(), appletTransform.m12(), appletTransform.m21(), appletTransform.m22(), 0, 0);
QPointF delta = t.map(curPos - lastPos);
moveBy(delta.x(), delta.y());
} else if (parent) {