diff options
Diffstat (limited to 'profile-widget')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 2 | ||||
-rw-r--r-- | profile-widget/ruleritem.cpp | 5 | ||||
-rw-r--r-- | profile-widget/ruleritem.h | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 49f99d20c..90638649d 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -691,7 +691,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict cylinderPressureAxis->setMinimum(plotInfo.minpressure); cylinderPressureAxis->setMaximum(plotInfo.maxpressure); #ifndef SUBSURFACE_MOBILE - rulerItem->setPlotInfo(plotInfo); + rulerItem->setPlotInfo(&displayed_dive, plotInfo); #endif #ifdef SUBSURFACE_MOBILE diff --git a/profile-widget/ruleritem.cpp b/profile-widget/ruleritem.cpp index 4cf766130..e5a420d34 100644 --- a/profile-widget/ruleritem.cpp +++ b/profile-widget/ruleritem.cpp @@ -113,7 +113,7 @@ void RulerItem2::recalculate() } QLineF line(startPoint, endPoint); setLine(line); - compare_samples(&pInfo, source->idx, dest->idx, buffer, 500, 1); + compare_samples(dive, &pInfo, source->idx, dest->idx, buffer, 500, 1); text = QString(buffer); // draw text @@ -148,8 +148,9 @@ RulerNodeItem2 *RulerItem2::destNode() const return dest; } -void RulerItem2::setPlotInfo(const plot_info &info) +void RulerItem2::setPlotInfo(const struct dive *d, const plot_info &info) { + dive = d; pInfo = info; dest->setPlotInfo(info); source->setPlotInfo(info); diff --git a/profile-widget/ruleritem.h b/profile-widget/ruleritem.h index 14cdbe36f..182303c17 100644 --- a/profile-widget/ruleritem.h +++ b/profile-widget/ruleritem.h @@ -36,7 +36,7 @@ public: explicit RulerItem2(); void recalculate(); - void setPlotInfo(const struct plot_info &pInfo); + void setPlotInfo(const struct dive *d, const struct plot_info &pInfo); RulerNodeItem2 *sourceNode() const; RulerNodeItem2 *destNode() const; void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth); @@ -47,6 +47,7 @@ slots: void settingsChanged(bool toggled); private: + const struct dive *dive; struct plot_info pInfo; QPointF startPoint, endPoint; RulerNodeItem2 *source, *dest; |