##// END OF EJS Templates
LineChartItem::updateGeometry(): Catch and warn about unexpected domains....
Friedemann Kleint -
r2771:8283f962d987
parent child
Show More
@@ -160,9 +160,14 void LineChartItem::updateGeometry()
160 }
160 }
161
161
162 bool dummyOk; // We know points are ok, but this is needed
162 bool dummyOk; // We know points are ok, but this is needed
163 qreal currentAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(currentSeriesPoint.x(), dummyOk);
163 qreal currentAngle = 0;
164 qreal previousAngle = static_cast<PolarDomain *>(domain())->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk);
164 qreal previousAngle = 0;
165
165 if (const PolarDomain *pd = qobject_cast<const PolarDomain *>(domain())) {
166 currentAngle = pd->toAngularCoordinate(currentSeriesPoint.x(), dummyOk);
167 previousAngle = pd->toAngularCoordinate(m_series->at(i - 1).x(), dummyOk);
168 } else {
169 qWarning() << Q_FUNC_INFO << "Unexpected domain: " << domain();
170 }
166 if ((qAbs(currentAngle - previousAngle) > 180.0)) {
171 if ((qAbs(currentAngle - previousAngle) > 180.0)) {
167 // If the angle between two points is over 180 degrees (half X range),
172 // If the angle between two points is over 180 degrees (half X range),
168 // any direct segment between them becomes meaningless.
173 // any direct segment between them becomes meaningless.
General Comments 0
You need to be logged in to leave comments. Login now