@@ -28,9 +28,13 QVariant BarAnimation::interpolated(const QVariant &from, const QVariant &to, qr | |||
|
28 | 28 | Q_ASSERT(startVector.count() == endVector.count()) ; |
|
29 | 29 | |
|
30 | 30 | for(int i =0 ;i< startVector.count();i++){ |
|
31 | //QRectF value = startVector[i] + ((endVector[i] - startVector[i]) * progress); | |
|
32 |
|
|
|
33 | QSizeF size = startVector[i].size() + ((endVector[i].size() - startVector[i].size()) * progress); | |
|
31 | qreal w = endVector[i].width(); | |
|
32 | qreal h = startVector[i].height() + ((endVector[i].height() - startVector[i].height()) * progress); | |
|
33 | qreal x = endVector[i].topLeft().x(); | |
|
34 | qreal y = endVector[i].topLeft().y() + endVector[i].height() - h; | |
|
35 | ||
|
36 | QPointF topLeft(x,y); | |
|
37 | QSizeF size(w,h); | |
|
34 | 38 | QRectF value(topLeft,size); |
|
35 | 39 | result << value; |
|
36 | 40 | } |
@@ -273,7 +273,6 void ChartAnimator::updateLayout(BarChartItem* item, const QVector<QRectF> &oldL | |||
|
273 | 273 | qDebug() << "ChartAnimator::updateLayout"; |
|
274 | 274 | BarAnimation* animation = static_cast<BarAnimation*>(m_animations.value(item)); |
|
275 | 275 | Q_ASSERT(animation); |
|
276 | // animation->updateValues(layout); | |
|
277 | 276 | animation->setDuration(duration); |
|
278 | 277 | animation->setKeyValueAt(0.0, qVariantFromValue(oldLayout)); |
|
279 | 278 | animation->setKeyValueAt(1.0, qVariantFromValue(newLayout)); |
General Comments 0
You need to be logged in to leave comments.
Login now