planner: pass in_planner argument to decoMode()

To remove reliance on global state, pass an "in_planner" argument
to decoMode(). Thus, calls to in_planner() can be removed.

This is a more-or-less automated change. Ultimately it would
probably be better to pass the current deco-mode to the affected
functions instead of calling decoMode() with an in_planner
parameter.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-12 18:19:24 +01:00 committed by Dirk Hohndel
parent 03a7e65cf0
commit 642d9c80b3
12 changed files with 51 additions and 51 deletions

View file

@ -217,7 +217,7 @@ void ToolTipItem::setTimeAxis(DiveCartesianAxis *axis)
timeAxis = axis;
}
void ToolTipItem::refresh(const dive *d, const QPointF &pos)
void ToolTipItem::refresh(const dive *d, const QPointF &pos, bool inPlanner)
{
static QPixmap tissues(16,60);
static QPainter painter(&tissues);
@ -249,7 +249,7 @@ void ToolTipItem::refresh(const dive *d, const QPointF &pos)
const struct plot_data *entry = &pInfo.entry[idx];
painter.setPen(QColor(0, 0, 0, 255));
if (decoMode() == BUEHLMANN)
if (decoMode(inPlanner) == BUEHLMANN)
painter.drawLine(0, lrint(60 - entry->gfline / 2), 16, lrint(60 - entry->gfline / 2));
painter.drawLine(0, lrint(60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure / 2),
16, lrint(60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure /2));