aboutsummaryrefslogtreecommitdiffstats
path: root/src/particles
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-05-01 16:57:05 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-03 08:05:33 +0200
commit51b3e8e7ef5af9ff6c40027daa3a04c58b6a4bd2 (patch)
treec642f8a63c62390c45c8306688d42a9a43872b12 /src/particles
parent94afc937e1973cd45a189a17190f636b22a3842c (diff)
Do not try to apply autoRotation when the particle has no velocity
Task-number: QTBUG-25025 Change-Id: Ibc1340d6ea0e36a8bf412f4da704ef8cd3447294 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
Diffstat (limited to 'src/particles')
-rw-r--r--src/particles/qquickimageparticle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index 268dfebce8..d20862a026 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -158,7 +158,8 @@ static const char vertexShaderCode[] =
" highp float rotation = vRotation.x + vRotation.y * t * vData.y;\n"
" if (vRotation.z == 1.0){\n"
" highp vec2 curVel = vVec.zw * t * vData.y + vVec.xy;\n"
- " rotation += atan(curVel.y, curVel.x);\n"
+ " if (length(curVel) > 0.)\n"
+ " rotation += atan(curVel.y, curVel.x);\n"
" }\n"
" highp vec2 trigCalcs = vec2(cos(rotation), sin(rotation));\n"
" highp vec4 deform = vDeformVec * currentSize * (vPosTex.zzww - 0.5);\n"