diff options
author | Suneel BS <suneel.b-s@nokia.com> | 2009-05-14 09:52:15 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-08-20 13:18:27 (GMT) |
commit | be6a9d6223b9a07a4563cfe63e54b93da959d8f4 (patch) | |
tree | fef09a0bf111f5b6d62dcb6faac6e60d1f831978 /src/svg/qsvgstyle_p.h | |
parent | a2d224b36be8ea23e64273b0224d1c0aba9ca9ac (diff) | |
download | Qt-be6a9d6223b9a07a4563cfe63e54b93da959d8f4.zip Qt-be6a9d6223b9a07a4563cfe63e54b93da959d8f4.tar.gz Qt-be6a9d6223b9a07a4563cfe63e54b93da959d8f4.tar.bz2 |
Fix for SVG animate-transform when additive = "replace".
On animate transform if additive = "replace" then transform specified
with the element should be replaced with value of animateTransform. If
additive = "sum" , then apply the animateTransform on top of element
level transform.
Reviewed-by: Kim
Diffstat (limited to 'src/svg/qsvgstyle_p.h')
-rw-r--r-- | src/svg/qsvgstyle_p.h | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h index c18a265..6f56574 100644 --- a/src/svg/qsvgstyle_p.h +++ b/src/svg/qsvgstyle_p.h @@ -250,7 +250,7 @@ public: { return m_style; } - + void setGradientId(const QString &Id) { m_gradientId = Id; @@ -529,20 +529,59 @@ public: SkewX, SkewY }; + enum Additive + { + Sum, + Replace + }; public: QSvgAnimateTransform(int startMs, int endMs, int by = 0); - void setArgs(TransformType type, const QVector<qreal> &args); + void setArgs(TransformType type, Additive additive, const QVector<qreal> &args); void setFreeze(bool freeze); void setRepeatCount(qreal repeatCount); virtual void apply(QPainter *p, const QRectF &, QSvgNode *node, QSvgExtraStates &states); virtual void revert(QPainter *p, QSvgExtraStates &states); virtual Type type() const; + QSvgAnimateTransform::Additive additiveType() const + { + return m_additive; + } + + bool animFinished(qreal totalTimeElapsed) + { + qreal animationFrame = (totalTimeElapsed - m_from) / m_to; + if (m_repeatCount >= 0 && m_repeatCount < animationFrame) + return true; + return false; + } + + qreal animStartTime() const + { + return m_from; + } + + void setTransformApplied(bool apply) + { + m_transformApplied = apply; + } + + bool transformApplied() const + { + return m_transformApplied; + } + + bool frozen() + { + return m_freeze; + } + protected: void resolveMatrix(QSvgNode *node); private: qreal m_from, m_to, m_by; qreal m_totalRunningTime; TransformType m_type; + Additive m_additive; QVector<qreal> m_args; int m_count; QTransform m_transform; @@ -550,6 +589,7 @@ private: bool m_finished; bool m_freeze; qreal m_repeatCount; + bool m_transformApplied; }; |