From 1fd6226d52b8d3d201b117902ff1ecd84cc1a1e5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Apr 2018 13:24:09 +0200 Subject: Fix rotate animation freezing in wrong position In QSvgAnimateTransform::resolveMatrix(), the indexes into the vals array were previously calculated to be 1,1 in the final step, where currentPosition=1, by using qCeil()/qFloor(), resulting in rotationDiff=0 and the rotation snapping back. Fix by setting startElem to endElem - 1 when available. Task-number: QTBUG-67525 Change-Id: Ie1d7e8be6ea8dd9aa155ee8c479037bc269f6df7 Reviewed-by: Eirik Aavitsland --- src/svg/qsvgstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp index ae714d7..5448797 100644 --- a/src/svg/qsvgstyle.cpp +++ b/src/svg/qsvgstyle.cpp @@ -694,8 +694,8 @@ void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node) } qreal currentPosition = percentOfAnimation * (m_count - 1); - int startElem = qFloor(currentPosition); int endElem = qCeil(currentPosition); + int startElem = qMax(endElem - 1, 0); switch(m_type) { -- cgit v1.2.1