Indicate negative cylider pressure

The planner can produce negative cylinder pressures when
more gas is used than available. Let's color the pressure
graph in a highly visible color to alert the user of the
fact that current gas planning is insufficient.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2019-08-08 11:33:10 +02:00 committed by Dirk Hohndel
parent f1fc328355
commit 826387a4b0
2 changed files with 5 additions and 1 deletions

View file

@ -809,7 +809,10 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
else
pen.setBrush(MED_GRAY_HIGH_TRANS);
} else {
pen.setBrush(getPressureColor(entry->density));
if (vAxis->valueAt(poly[i]) < 0)
pen.setBrush(MAGENTA);
else
pen.setBrush(getPressureColor(entry->density));
}
painter->setPen(pen);
painter->drawLine(poly[i - 1], poly[i]);