diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-08-19 15:41:38 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-08-20 13:23:03 (GMT) |
commit | 984773a54975ed26c5e7aef5d8ff095ca1dfad3d (patch) | |
tree | 5fe4954a17105ef7e51644f42113a6ee079e1b81 /src/svg/qsvgstyle_p.h | |
parent | 9162508604dc05c7de2a5ea02a20369681b06456 (diff) | |
download | Qt-984773a54975ed26c5e7aef5d8ff095ca1dfad3d.zip Qt-984773a54975ed26c5e7aef5d8ff095ca1dfad3d.tar.gz Qt-984773a54975ed26c5e7aef5d8ff095ca1dfad3d.tar.bz2 |
Improved support for SVG animation.
Added support for from-by-animation and by-animation in the
animateTransform element. Updated bubbles.svg in the svgviewer example
to make it work like intended with the corrected animation code.
Task-number: Partially fixes 254784
Reviewed-by: Trond
Diffstat (limited to 'src/svg/qsvgstyle_p.h')
-rw-r--r-- | src/svg/qsvgstyle_p.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h index 6f56574..056b73b 100644 --- a/src/svg/qsvgstyle_p.h +++ b/src/svg/qsvgstyle_p.h @@ -547,22 +547,18 @@ public: return m_additive; } - bool animFinished(qreal totalTimeElapsed) + bool animActive(qreal totalTimeElapsed) { - qreal animationFrame = (totalTimeElapsed - m_from) / m_to; - if (m_repeatCount >= 0 && m_repeatCount < animationFrame) + if (totalTimeElapsed < m_from) + return false; + if (m_freeze || m_repeatCount < 0) // fill="freeze" or repeat="indefinite" return true; - return false; - } - - qreal animStartTime() const - { - return m_from; - } - - void setTransformApplied(bool apply) - { - m_transformApplied = apply; + if (m_totalRunningTime == 0) + return false; + qreal animationFrame = (totalTimeElapsed - m_from) / m_totalRunningTime; + if (animationFrame > m_repeatCount) + return false; + return true; } bool transformApplied() const @@ -570,9 +566,10 @@ public: return m_transformApplied; } - bool frozen() + // Call this instead of revert if you know that revert is unnecessary. + void clearTransformApplied() { - return m_freeze; + m_transformApplied = false; } protected: |