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>
This commit is contained in:
Robert C. Helling 2014-11-24 15:43:37 +01:00 committed by Dirk Hohndel
parent 79d5a41182
commit 4a751750e0

View file

@ -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);