From 525eebcd3aa9b1c04bc6489ebe73c18d619ebdf9 Mon Sep 17 00:00:00 2001 From: Alan Alpert <416365416c@gmail.com> Date: Wed, 21 Nov 2012 19:49:39 -0800 Subject: [PATCH] Apply full transform MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Samuel Rødal Reviewed-by: Gunnar Sletta --- src/particles/qquickparticlesystem.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp index a43b300..e0b050d 100644 --- a/src/particles/qquickparticlesystem.cpp +++ b/src/particles/qquickparticlesystem.cpp @@ -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); -- 2.7.4