diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-04-06 15:04:20 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:33 (GMT) |
commit | 9fa3643a4fb707958ea43fda14e6eddc18bc9a1d (patch) | |
tree | a0c534e2bdc684da28540c487defa60e000097b2 | |
parent | 037d7347886dcebff34d9987183623dfeb41861a (diff) | |
download | Qt-9fa3643a4fb707958ea43fda14e6eddc18bc9a1d.zip Qt-9fa3643a4fb707958ea43fda14e6eddc18bc9a1d.tar.gz Qt-9fa3643a4fb707958ea43fda14e6eddc18bc9a1d.tar.bz2 |
Moved item wouldn't follow mouse cursor when ItemIgnoresTransformations is set
Since the introduction of transform properties in QGraphicsItem,
QGraphicsItem::transform() is no longer enough to get the correct
transform of an item.
No auto-test as it involves mouse dragging.
Reviewed-by: Yoann
Task-number: QTBUG-9295
(cherry picked from commit 253b87180e0a6c5db0feaaed7e321139c4ff1643)
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b263d63..e12ea80 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -6984,7 +6984,8 @@ void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // Root items that ignore transformations need to // calculate their diff by mapping viewport coordinates // directly to parent coordinates. - QTransform viewToParentTransform = (item->transform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y())) + // COMBINE + QTransform viewToParentTransform = (item->d_func()->transformData->computedFullTransform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y())) * (item->sceneTransform() * view->viewportTransform()).inverted(); currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos()))); buttonDownParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton)))); |