diff options
author | Robert C. Helling <helling@atdotde.de> | 2019-08-08 11:33:10 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-08-08 08:56:44 -0700 |
commit | 826387a4b0f177c5b645c2483ca4fb11c76e01dc (patch) | |
tree | 74045ff506d13b8434faea64775b57c6c1f87a89 | |
parent | f1fc3283557d0cdb7338c5ab99fa0d8385c5dfa2 (diff) | |
download | subsurface-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>
-rw-r--r-- | core/color.h | 1 | ||||
-rw-r--r-- | profile-widget/diveprofileitem.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/core/color.h b/core/color.h index 246808d19..12dcb1497 100644 --- a/core/color.h +++ b/core/color.h @@ -65,6 +65,7 @@ // Magentas #define MEDIUMREDVIOLET1_HIGHER_TRANS QColor::fromRgbF(0.7, 0.2, 0.7, 0.1) +#define MAGENTA QColor::fromRgbF(1.0, 0.0, 1.0, 1.0) #define SAC_COLORS_START_IDX SAC_1 #define SAC_COLORS 9 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]); |