diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 6c0e742..259c50f 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -2478,6 +2478,8 @@ static bool parseAnimateTransformNode(QSvgNode *parent,
     }
 
     QSvgAnimateTransform *anim = new QSvgAnimateTransform(begin, end, 0);
+qDebug() << type << begin << end <<  vals     << fillStr
+         << "additive=" << additive;
     anim->setArgs(type, additive, vals);
     anim->setFreeze(fillStr == QLatin1String("freeze"));
     anim->setRepeatCount(
diff --git a/src/svg/qsvgstyle.cpp b/src/svg/qsvgstyle.cpp
index ae714d7..23b7829 100644
--- a/src/svg/qsvgstyle.cpp
+++ b/src/svg/qsvgstyle.cpp
@@ -436,6 +436,8 @@ void QSvgGradientStyle::setMatrix(const QMatrix &mat)
 QSvgTransformStyle::QSvgTransformStyle(const QTransform &trans)
     : m_transform(trans)
 {
+    qDebug() << __FUNCTION__ << m_transform;
+
 }
 
 void QSvgTransformStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &)
@@ -446,6 +448,7 @@ void QSvgTransformStyle::apply(QPainter *p, const QSvgNode *, QSvgExtraStates &)
 
 void QSvgTransformStyle::revert(QPainter *p, QSvgExtraStates &)
 {
+    qDebug() << __FUNCTION__ ;
     p->setWorldTransform(m_oldWorldTransform, false /* don't combine */);
 }
 
@@ -549,6 +552,7 @@ void QSvgStyle::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states
     //animated transforms have to be applied
     //_after_ the original object transformations
     if (!animateTransforms.isEmpty()) {
+qDebug()         << "QSvgStyle::apply()" << animateTransforms.size();
         qreal totalTimeElapsed = node->document()->currentElapsed();
         // Find the last animateTransform with additive="replace", since this will override all
         // previous animateTransforms.
@@ -578,10 +582,12 @@ void QSvgStyle::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states
     if (compop) {
         compop->apply(p, node, states);
     }
+    qDebug()         << "<QSvgStyle::apply()";
 }
 
 void QSvgStyle::revert(QPainter *p, QSvgExtraStates &states)
 {
+    qDebug()         << ">QSvgStyle::revert()";
     if (quality) {
         quality->revert(p, states);
     }
@@ -605,6 +611,7 @@ void QSvgStyle::revert(QPainter *p, QSvgExtraStates &states)
     //animated transforms need to be reverted _before_
     //the native transforms
     if (!animateTransforms.isEmpty()) {
+        qDebug()         << "  >QSvgStyle::revert() animateTransforms="<<animateTransforms.size();
         QList<QSvgRefCounter<QSvgAnimateTransform> >::const_iterator itr = animateTransforms.constBegin();
         for (; itr != animateTransforms.constEnd(); ++itr) {
             if ((*itr)->transformApplied()) {
@@ -614,6 +621,7 @@ void QSvgStyle::revert(QPainter *p, QSvgExtraStates &states)
         }
         for (; itr != animateTransforms.constEnd(); ++itr)
             (*itr)->clearTransformApplied();
+        qDebug()         << "  <QSvgStyle::revert() animateTransforms";
     }
 
     if (transform) {
@@ -631,6 +639,7 @@ void QSvgStyle::revert(QPainter *p, QSvgExtraStates &states)
     if (compop) {
         compop->revert(p, states);
     }
+    qDebug()         << "<QSvgStyle::revert()";
 }
 
 QSvgAnimateTransform::QSvgAnimateTransform(int startMs, int endMs, int byMs )
@@ -645,9 +654,15 @@ QSvgAnimateTransform::QSvgAnimateTransform(int startMs, int endMs, int byMs )
       m_repeatCount(-1.),
       m_transformApplied(false)
 {
+    qDebug() << "QSvgAnimateTransform";
     Q_UNUSED(byMs);
 }
 
+QSvgAnimateTransform::~QSvgAnimateTransform()
+{
+     qDebug() << "~QSvgAnimateTransform";
+}
+
 void QSvgAnimateTransform::setArgs(TransformType type, Additive additive, const QVector<qreal> &args)
 {
     m_type = type;
@@ -659,6 +674,7 @@ void QSvgAnimateTransform::setArgs(TransformType type, Additive additive, const
 
 void QSvgAnimateTransform::apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &)
 {
+    qDebug() << "SvgAnimateTransform::apply";
     m_oldWorldTransform = p->worldTransform();
     resolveMatrix(node);
     p->setWorldTransform(m_transform, true);
@@ -667,6 +683,7 @@ void QSvgAnimateTransform::apply(QPainter *p, const QSvgNode *node, QSvgExtraSta
 
 void QSvgAnimateTransform::revert(QPainter *p, QSvgExtraStates &)
 {
+    qDebug() << "SvgAnimateTransform::revert";
     p->setWorldTransform(m_oldWorldTransform, false /* don't combine */);
     m_transformApplied = false;
 }
@@ -675,27 +692,44 @@ void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node)
 {
     static const qreal deg2rad = qreal(0.017453292519943295769);
     qreal totalTimeElapsed = node->document()->currentElapsed();
-    if (totalTimeElapsed < m_from || m_finished)
+    qDebug() <<  __FUNCTION__ << __FILE__ << ':' << __LINE__
+              << "totalTimeElapsed=" << totalTimeElapsed;
+
+    if (totalTimeElapsed < m_from || m_finished) {
+        qDebug() << __FUNCTION__ << "totalTimeElapsed < m_from" << (totalTimeElapsed < m_from)
+        << "finis" << m_finished ;
         return;
+    }
 
     qreal animationFrame = 0;
     if (m_totalRunningTime != 0) {
         animationFrame = (totalTimeElapsed - m_from) / m_totalRunningTime;
 
         if (m_repeatCount >= 0 && m_repeatCount < animationFrame) {
+            qDebug() << __FUNCTION__ << "setting m_finished animationFrame=" << animationFrame
+                     << "setting to m_repeatCount" << m_repeatCount;
             m_finished = true;
             animationFrame = m_repeatCount;
+        } else {
+            qDebug() << __FUNCTION__ << "continuing animationFrame=" << animationFrame;
         }
     }
 
     qreal percentOfAnimation = animationFrame;
+    qDebug() << __FUNCTION__ << "percentOfAnimation/animationFrame"  << percentOfAnimation;
     if (percentOfAnimation > 1) {
         percentOfAnimation -= ((int)percentOfAnimation);
+        qDebug() << __FUNCTION__ << "clamped percentOfAnimation"  << percentOfAnimation;
     }
 
     qreal currentPosition = percentOfAnimation * (m_count - 1);
     int startElem = qFloor(currentPosition);
     int endElem   = qCeil(currentPosition);
+    qDebug() << __FUNCTION__ << __FILE__ << ':' << __LINE__
+             << "m_count=" << m_count
+             << "currentPosition=" << currentPosition
+             << "percentOfAnimation=" << percentOfAnimation
+             << "start/EndElem=" << startElem << endElem;
 
     switch(m_type)
     {
@@ -750,6 +784,11 @@ void QSvgAnimateTransform::resolveMatrix(const QSvgNode *node)
         to3   = m_args[endElem++];
 
         qreal rotationDiff = (to1 - from1) * percentOfAnimation;
+        qDebug() << __FUNCTION__
+                 << "animationFrame=" << animationFrame
+                 << "percentOfAnimation=" << percentOfAnimation
+                  << "to1=" <<to1 << "from1=" <<  from1 << "d=" << (to1 - from1)
+                 << "rotationDiff=" << rotationDiff;
         //qreal rotation = from1 + rotationDiff;
 
         qreal transXDiff = (to2-from2) * percentOfAnimation;
diff --git a/src/svg/qsvgstyle_p.h b/src/svg/qsvgstyle_p.h
index 916c9fa..4d2b94d 100644
--- a/src/svg/qsvgstyle_p.h
+++ b/src/svg/qsvgstyle_p.h
@@ -647,6 +647,7 @@ public:
     };
 public:
     QSvgAnimateTransform(int startMs, int endMs, int by = 0);
+    ~QSvgAnimateTransform();
     void setArgs(TransformType type, Additive additive, const QVector<qreal> &args);
     void setFreeze(bool freeze);
     void setRepeatCount(qreal repeatCount);
@@ -662,8 +663,10 @@ public:
     {
         if (totalTimeElapsed < m_from)
             return false;
-        if (m_freeze || m_repeatCount < 0) // fill="freeze" or repeat="indefinite"
+        if (m_freeze || m_repeatCount < 0) { // fill="freeze" or repeat="indefinite"
+//            qDebug() << __FUNCTION__ << "m_freeze";
             return true;
+        }
         if (m_totalRunningTime == 0)
             return false;
         qreal animationFrame = (totalTimeElapsed - m_from) / m_totalRunningTime;
@@ -680,6 +683,7 @@ public:
     // Call this instead of revert if you know that revert is unnecessary.
     void clearTransformApplied()
     {
+        qDebug() << __FUNCTION__;
         m_transformApplied = false;
     }
 
