QtLottie: Bug fixes.

This commit is contained in:
John Preston 2019-05-02 17:18:23 +04:00
parent 9b7e3dc3ec
commit 48eb5dd112
2 changed files with 10 additions and 6 deletions

@ -1 +1 @@
Subproject commit 1d23bd35d1e540d7c1aaf7ff88db22d914f4947c
Subproject commit 5213d12d619e3a37fb912153990ceb1e49e0adc6

View File

@ -431,11 +431,15 @@ public:
if (!this->m_animated)
return false;
int adjustedFrame = qBound(this->m_startFrame, frame, this->m_endFrame);
if (const EasingSegment<T> *easing = BMProperty<T>::getEasingSegment(adjustedFrame)) {
qreal progress = ((adjustedFrame - this->m_startFrame) * 1.0) /
(this->m_endFrame - this->m_startFrame);
qreal easedValue = easing->easing.valueForProgress(progress);
int adjustedFrame = qBound(this->m_startFrame, frame, this->m_endFrame);
if (const EasingSegment<T> *easing = BMProperty<T>::getEasingSegment(adjustedFrame)) {
qreal progress;
if (easing->endFrame == easing->startFrame)
progress = 1;
else
progress = ((adjustedFrame - easing->startFrame) * 1.0) /
(easing->endFrame - easing->startFrame);
qreal easedValue = easing->easing.valueForProgress(progress);
// For the time being, 4D vectors are used only for colors, and
// the value must be restricted to between [0, 1]
easedValue = qBound(qreal(0.0), easedValue, qreal(1.0));