Apply full transform
authorAlan Alpert <416365416c@gmail.com>
Thu, 22 Nov 2012 03:49:39 +0000 (19:49 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 29 Nov 2012 07:49:45 +0000 (08:49 +0100)
Previously the particle system was only applying the translaton of the
relative transfrom from any emitters. Now the full transform is used.

Task-number: QTBUG-25518
Change-Id: I4c654837c37dbef8f6f407387ce4ea82cb3b821c
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
src/particles/qquickparticlesystem.cpp

index a43b300..e0b050d 100644 (file)
@@ -1094,10 +1094,13 @@ QQuickParticleData* QQuickParticleSystem::newDatum(int groupId, bool respectLimi
 void QQuickParticleSystem::emitParticle(QQuickParticleData* pd)
 {// called from prepareNextFrame()->emitWindow - enforce?
     //Account for relative emitter position
-    QPointF offset = this->mapFromItem(pd->e, QPointF(0, 0));
-    if (!offset.isNull()) {
-        pd->x += offset.x();
-        pd->y += offset.y();
+    bool okay = false;
+    QTransform t = pd->e->itemTransform(this, &okay);
+    if (okay) {
+        qreal tx,ty;
+        t.map(pd->x, pd->y, &tx, &ty);
+        pd->x = tx;
+        pd->y = ty;
     }
 
     finishNewDatum(pd);