summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index b7682f9df..23c41a708 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -359,9 +359,11 @@ void DiveGasPressureItem::paint(QPainter* painter, const QStyleOptionGraphicsIte
QPen pen;
pen.setCosmetic(true);
pen.setWidth(2);
+ struct dive *d = getDiveById(dataModel->id());
+ struct plot_data *entry = dataModel->data();
Q_FOREACH(const QPolygonF& poly, polygons) {
- for (int i = 1, count = poly.count(); i < count; i++) {
- pen.setBrush(QBrush(Qt::red)); // TODO: Fix the color.
+ for (int i = 1, count = poly.count(); i < count; i++, entry++) {
+ pen.setBrush(getSacColor(entry->sac, d->sac));
painter->setPen(pen);
painter->drawLine(poly[i-1],poly[i]);
}