From 31d1d1f4217cab43c1fa6ca5612c2cc3ccc656eb Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 23 Oct 2015 22:11:00 +0200 Subject: Don't change pen color when for zero SAC When for individual plot entries the SAC is zero this comes from gas changes and the SAC calculation needing a bit more pressure data and not from the diver switching to freediving mode. So we shold not change the pen color on the pressure line for that but pretend we are still breathing at the previous SAC. Signed-off-by: Robert C. Helling --- qt-ui/profile/diveprofileitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 986a0eac0..cff2b1f43 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -780,7 +780,8 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte Q_FOREACH (const QPolygonF &poly, polygons) { entry = dataModel->data().entry; for (int i = 1, count = poly.count(); i < count; i++, entry++) { - pen.setBrush(getSacColor(entry->sac, displayed_dive.sac)); + if (entry->sac) + pen.setBrush(getSacColor(entry->sac, displayed_dive.sac)); painter->setPen(pen); painter->drawLine(poly[i - 1], poly[i]); } -- cgit v1.2.3-70-g09d2