From 98f55621584eb077cd462a9a3747ed5d2cdd9166 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <helling@atdotde.de>
Date: Mon, 24 Nov 2014 15:43:37 +0100
Subject: [PATCH] Reset plot info pointer when painting several polyons

For each polygon that we paint we have to step through the
plot_info from the start again.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
---
 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 8ee0f34..e2148bf 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -685,8 +685,9 @@ void DiveGasPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
 	pen.setCosmetic(true);
 	pen.setWidth(2);
 	painter->save();
-	struct plot_data *entry = dataModel->data().entry;
+	struct plot_data *entry;
 	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));
 			painter->setPen(pen);
-- 
1.9.3 (Apple Git-50)

