summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Kosinski <lukasz@scythe-studio.com>2021-05-26 13:02:20 +0200
committerLukas Kosinski <lukasz@scythe-studio.com>2021-06-01 12:04:53 +0200
commite8d6da6363d894a5d1c6f8bf164818913a1041eb (patch)
treedf2d036951b661e4937555db1bec2dd789f194b5 /src
parenta27897c15f284d04375b2e2c4f96eea08b3013ac (diff)
Problem with coloring unselected points in linechartitem.cpp fixed
There was a problem occurring when user selected a point and all points after that point were also colored in the same way as normal points. It was fixed by saving and restoring QPainter when needed. Task-number: QTBUG-94025 Change-Id: I26aca0c93c8dd6e321ce66ec4f3dba9a688a6b2e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/charts/linechart/linechartitem.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/charts/linechart/linechartitem.cpp b/src/charts/linechart/linechartitem.cpp
index 6b70bf6d..7ed70b72 100644
--- a/src/charts/linechart/linechartitem.cpp
+++ b/src/charts/linechart/linechartitem.cpp
@@ -493,6 +493,7 @@ void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
qreal ptSize = m_markerSize;
for (int i = 0; i < m_linePoints.size(); ++i) {
if (clipRect.contains(m_linePoints.at(i))) {
+ painter->save();
ptSize = m_markerSize;
bool drawPoint = m_pointsVisible && m_series->lightMarker().isNull();
if (m_pointsConfiguration.contains(i)) {
@@ -525,6 +526,8 @@ void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
if (drawPoint)
painter->drawEllipse(m_linePoints.at(i), ptSize, ptSize);
+
+ painter->restore();
}
}
}