summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2014-11-24 15:43:37 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-24 06:50:19 -0800
commit4a751750e0e18a6c71ee63930faf91b799c53d0b (patch)
tree1690f8ee7ee6dc3ebf801b8804cda9027d8bc6e7 /qt-ui
parent79d5a411824510c13012b28d636d4af4790a4efa (diff)
downloadsubsurface-4a751750e0e18a6c71ee63930faf91b799c53d0b.tar.gz
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> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 8ee0f3494..e2148bf7c 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);