diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-09 18:25:04 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-10 15:57:39 -0800 |
commit | 88c6ce988dfc1b5ad40eb9c425d705c8ac136570 (patch) | |
tree | 49a7642f6fa40b2a8a3e65e9d4ebc48dfc51e29a /profile-widget/ruleritem.cpp | |
parent | 54e8fe5d9e588c3345ded27982edaf72654fc8d1 (diff) | |
download | subsurface-88c6ce988dfc1b5ad40eb9c425d705c8ac136570.tar.gz |
profile: pass dive to RulerItem
Instead of accessing the global displayed_dive variable
in RulerItem, pass the dive. This is a step in making the
profile reentrant.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/ruleritem.cpp')
-rw-r--r-- | profile-widget/ruleritem.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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); |