summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvgstyle_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/svg/qsvgstyle_p.h')
-rw-r--r--src/svg/qsvgstyle_p.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h
index c18a265be9..6f565741e0 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;
};