diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-07-04 10:34:30 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-07-04 10:34:30 -0300 |
commit | ae08a81739eacb0be86811274ecf9ec786626d1b (patch) | |
tree | 1457e3d62646d19d090ea63441a06522f1975c74 /qt-ui/diveplanner.cpp | |
parent | 20ec98f2a5e31a91cc779666fa72ac2961bc87df (diff) | |
download | subsurface-ae08a81739eacb0be86811274ecf9ec786626d1b.tar.gz |
Fixed the 'hard to grab' Handler, Dive Planner now is very smooth.
So, it was on the docs, but I didn't read it before, if the
scene has items that ignores transformations, we need to
pass the view transform to the method that gets the items
in the scene. I also used IntersectsItemBoundingRect instead
of IntersectsItemsShape because it's faster, and our items
are small, so we don't need an very accurate but slower method.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 5de5ffe6b..3e107b10c 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -364,7 +364,7 @@ bool DivePlannerGraphics::isPointOutOfBoundaries(const QPointF& point) void DivePlannerGraphics::mousePressEvent(QMouseEvent* event) { QPointF mappedPos = mapToScene(event->pos()); - Q_FOREACH(QGraphicsItem *item, scene()->items(mappedPos)) { + Q_FOREACH(QGraphicsItem *item, scene()->items(mappedPos, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, transform())){ if (DiveHandler *h = qgraphicsitem_cast<DiveHandler*>(item)) { activeDraggedHandler = h; activeDraggedHandler->setBrush(Qt::red); |