summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveprofileitem.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-04 00:00:38 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-10 15:57:39 -0800
commit0392994df0c9cd99df946633d6e318bd0548a3b9 (patch)
treea907006308ea681cb6a92bcd952a874a900be2f5 /profile-widget/diveprofileitem.h
parentacee77e516bc77cd49a57b5aac620833ea655eb6 (diff)
downloadsubsurface-0392994df0c9cd99df946633d6e318bd0548a3b9.tar.gz
profile: move calculations out of DiveGasPressureItem::paint()
With the same argument as for DivePercentageItem, move access to live data out of the paint() function. Instead, calculate colors in replot(), where the other data are calculated. This is slightly more complicated than in DivePercentageItem, since there are multiple polygons. Therefore, replace QPolygonF by a vector of structures contained the position and color of the data point. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/diveprofileitem.h')
-rw-r--r--profile-widget/diveprofileitem.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/profile-widget/diveprofileitem.h b/profile-widget/diveprofileitem.h
index 18902374a..da6217170 100644
--- a/profile-widget/diveprofileitem.h
+++ b/profile-widget/diveprofileitem.h
@@ -162,7 +162,11 @@ public:
private:
void plotPressureValue(int mbar, int sec, QFlags<Qt::AlignmentFlag> align, double offset);
void plotGasValue(int mbar, int sec, struct gasmix gasmix, QFlags<Qt::AlignmentFlag> align, double offset);
- QVector<QPolygonF> polygons;
+ struct Entry {
+ QPointF pos;
+ QColor col;
+ };
+ std::vector<std::vector<Entry>> polygons;
};
class DiveCalculatedCeiling : public AbstractProfilePolygonItem {