mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Only update the "add dive profile / plan dive" 20x/s
We were updating the dive quite a lot of times, we really didn't need to. This will help, but not fix, the issues with plan / add dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f5726ffa9d
commit
5a1be7620b
2 changed files with 8 additions and 0 deletions
|
@ -181,6 +181,7 @@ DiveHandler::DiveHandler() : QGraphicsEllipseItem()
|
|||
setFlags(ItemIgnoresTransformations | ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges);
|
||||
setBrush(Qt::white);
|
||||
setZValue(2);
|
||||
t.start();
|
||||
}
|
||||
|
||||
int DiveHandler::parentIndex()
|
||||
|
@ -225,9 +226,14 @@ void DiveHandler::changeGas()
|
|||
|
||||
void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (t.elapsed() < 40)
|
||||
return;
|
||||
t.start();
|
||||
|
||||
ProfileWidget2 *view = qobject_cast<ProfileWidget2*>(scene()->views().first());
|
||||
if(view->isPointOutOfBoundaries(event->scenePos()))
|
||||
return;
|
||||
|
||||
QGraphicsEllipseItem::mouseMoveEvent(event);
|
||||
emit moved();
|
||||
}
|
||||
|
|
|
@ -133,6 +133,8 @@ public
|
|||
slots:
|
||||
void selfRemove();
|
||||
void changeGas();
|
||||
private:
|
||||
QTime t;
|
||||
};
|
||||
|
||||
#include "ui_diveplanner.h"
|
||||
|
|
Loading…
Add table
Reference in a new issue