##// END OF EJS Templates
Fixed pen style pattern continuity for line series...
Miikka Heikkinen -
r2457:4dae82608139
parent child
Show More
@@ -123,15 +123,23 void LineChartItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
123
123
124 painter->save();
124 painter->save();
125 painter->setPen(m_linePen);
125 painter->setPen(m_linePen);
126 painter->setBrush(m_linePen.color());
127 painter->setClipRect(QRectF(QPointF(0,0),domain()->size()));
126 painter->setClipRect(QRectF(QPointF(0,0),domain()->size()));
128
127
129 if (m_pointsVisible) {
128 if (m_pointsVisible) {
129 painter->setBrush(m_linePen.color());
130 painter->drawPath(m_linePath);
130 painter->drawPath(m_linePath);
131 } else {
131 } else {
132 for (int i(1); i < m_points.size(); i++)
132 painter->setBrush(QBrush(Qt::NoBrush));
133 painter->drawLine(m_points.at(i - 1), m_points.at(i));
133 if (m_linePen.style() != Qt::SolidLine) {
134 // If pen style is not solid line, always fall back to path painting
135 // to ensure proper continuity of the pattern
136 painter->drawPath(m_linePath);
137 } else {
138 for (int i(1); i < m_points.size(); i++)
139 painter->drawLine(m_points.at(i - 1), m_points.at(i));
140 }
134 }
141 }
142
135 painter->restore();
143 painter->restore();
136 }
144 }
137
145
General Comments 0
You need to be logged in to leave comments. Login now