aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/divetooltipitem.cpp')
-rw-r--r--qt-ui/profile/divetooltipitem.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index 0f7191474..b2b72ed58 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -144,7 +144,8 @@ ToolTipItem::ToolTipItem(QGraphicsItem* parent) : QGraphicsPathItem(parent),
separator(new QGraphicsLineItem(this)),
title(new QGraphicsSimpleTextItem(tr("Information"), this)),
status(COLLAPSED),
- timeAxis(0)
+ timeAxis(0),
+ lastTime(-1)
{
memset(&pInfo, 0, sizeof(pInfo));
@@ -231,8 +232,12 @@ void ToolTipItem::setTimeAxis(DiveCartesianAxis* axis)
void ToolTipItem::refresh(const QPointF& pos)
{
- clear();
int time = timeAxis->valueAt( pos );
+ if (time == lastTime)
+ return;
+
+ lastTime = time;
+ clear();
struct membuffer mb = { 0 };
get_plot_details_new(&pInfo, time, &mb);