##// END OF EJS Templates
Bugfix wrong index when points added to xychart
Michal Klocek -
r602:bca04263a9c1
parent child
Show More
@@ -55,7 +55,8 QVariant XYAnimation::interpolated(const QVariant &start, const QVariant & end,
55
55
56 case MoveDownAnimation: {
56 case MoveDownAnimation: {
57
57
58 Q_ASSERT(startVector.count() == endVector.count());
58 if(startVector.count() != endVector.count()) break;
59
59 for(int i =0;i< startVector.count();i++) {
60 for(int i =0;i< startVector.count();i++) {
60 qreal x = startVector[i].x() + ((endVector[i].x()- startVector[i].x()) * progress);
61 qreal x = startVector[i].x() + ((endVector[i].x()- startVector[i].x()) * progress);
61 qreal y = startVector[i].y() + ((endVector[i].y()- startVector[i].y()) * progress);
62 qreal y = startVector[i].y() + ((endVector[i].y()- startVector[i].y()) * progress);
@@ -94,7 +94,7 void XYChartItem::handlePointAdded(int index)
94
94
95 QPointF point = calculateGeometryPoint(index);
95 QPointF point = calculateGeometryPoint(index);
96 QVector<QPointF> points = m_points;
96 QVector<QPointF> points = m_points;
97 points.insert(index,point);
97 points.insert(index-1,point);
98 updateLayout(points);
98 updateLayout(points);
99 update();
99 update();
100 }
100 }
@@ -102,7 +102,6 void XYChartItem::handlePointRemoved(int index)
102 {
102 {
103 Q_ASSERT(index<m_series->count() + 1);
103 Q_ASSERT(index<m_series->count() + 1);
104 Q_ASSERT(index>=0);
104 Q_ASSERT(index>=0);
105 // QPointF point = calculateGeometryPoint(index);
106 QVector<QPointF> points = m_points;
105 QVector<QPointF> points = m_points;
107 points.remove(index);
106 points.remove(index);
108 updateLayout(points);
107 updateLayout(points);
General Comments 0
You need to be logged in to leave comments. Login now