@@ -397,22 +397,20 QXYSeriesPrivate::QXYSeriesPrivate(QXYSeries *q) : | |||
|
397 | 397 | |
|
398 | 398 | void QXYSeriesPrivate::scaleDomain(Domain& domain) |
|
399 | 399 | { |
|
400 |
qreal minX( |
|
|
401 |
qreal minY( |
|
|
402 |
qreal maxX( |
|
|
403 |
qreal maxY( |
|
|
400 | qreal minX(0); | |
|
401 | qreal minY(0); | |
|
402 | qreal maxX(1); | |
|
403 | qreal maxY(1); | |
|
404 | 404 | |
|
405 | 405 | Q_Q(QXYSeries); |
|
406 | 406 | |
|
407 | 407 | const QList<QPointF>& points = q->points(); |
|
408 | 408 | |
|
409 | ||
|
410 | if (points.isEmpty()){ | |
|
411 | minX = qMin(minX, (qreal)0.0); | |
|
412 | minY = qMin(minY, (qreal)0.0); | |
|
413 | maxX = qMax(maxX, (qreal)1.0); | |
|
414 | maxY = qMax(maxY, (qreal)1.0); | |
|
415 | } | |
|
409 | if (!points.isEmpty()){ | |
|
410 | minX = points[0].x(); | |
|
411 | minY = points[0].y(); | |
|
412 | maxX = minX; | |
|
413 | maxY = minY; | |
|
416 | 414 | |
|
417 | 415 | for (int i = 0; i < points.count(); i++) { |
|
418 | 416 | qreal x = points[i].x(); |
@@ -422,6 +420,7 void QXYSeriesPrivate::scaleDomain(Domain& domain) | |||
|
422 | 420 | maxX = qMax(maxX, x); |
|
423 | 421 | maxY = qMax(maxY, y); |
|
424 | 422 | } |
|
423 | } | |
|
425 | 424 | |
|
426 | 425 | domain.setRange(minX,maxX,minY,maxY); |
|
427 | 426 | } |
General Comments 0
You need to be logged in to leave comments.
Login now