From 826387a4b0f177c5b645c2483ca4fb11c76e01dc Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Thu, 8 Aug 2019 11:33:10 +0200 Subject: 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 --- profile-widget/diveprofileitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'profile-widget') 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]); -- cgit v1.2.3-70-g09d2