profile: pass dive to ToolTipItem::refresh()

Don't access the global displayed_dive variable in a step
to make the profile reentrant.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-09 18:11:56 +01:00 committed by Dirk Hohndel
parent 193513a61f
commit 54e8fe5d9e
5 changed files with 10 additions and 10 deletions

View file

@ -222,7 +222,7 @@ void ToolTipItem::setTimeAxis(DiveCartesianAxis *axis)
timeAxis = axis;
}
void ToolTipItem::refresh(const QPointF &pos)
void ToolTipItem::refresh(const dive *d, const QPointF &pos)
{
static QPixmap tissues(16,60);
static QPainter painter(&tissues);
@ -238,7 +238,7 @@ void ToolTipItem::refresh(const QPointF &pos)
clear();
mb.len = 0;
int idx = get_plot_details_new(&pInfo, time, &mb);
int idx = get_plot_details_new(d, &pInfo, time, &mb);
tissues.fill();
painter.setPen(QColor(0, 0, 0, 0));