mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
20ec98f2a5
commit
ae08a81739
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue