aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-08-08 11:33:10 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-08-08 08:56:44 -0700
commit826387a4b0f177c5b645c2483ca4fb11c76e01dc (patch)
tree74045ff506d13b8434faea64775b57c6c1f87a89 /profile-widget
parentf1fc3283557d0cdb7338c5ab99fa0d8385c5dfa2 (diff)
downloadsubsurface-826387a4b0f177c5b645c2483ca4fb11c76e01dc.tar.gz
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>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/diveprofileitem.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index 6d5cdb2da..521e3fb82 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -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]);