summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-07-16 01:08:06 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-07-16 01:08:06 (GMT)
commit87c97621a1b6ff958d773559f5c39db010c9b073 (patch)
treedeb2342b42270b01781eb2065ffa1edd5f3e530d /src/declarative
parent6eb1e397491c2d73aa40f3273cb20b371efad35a (diff)
downloadQt-87c97621a1b6ff958d773559f5c39db010c9b073.zip
Qt-87c97621a1b6ff958d773559f5c39db010c9b073.tar.gz
Qt-87c97621a1b6ff958d773559f5c39db010c9b073.tar.bz2
Fixes bugs with particles
Fixed: Particle count changes had a noticable delay Fixed: Changing from zero to non-zero didn't work
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/extra/qfxparticles.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp
index 3130f06..e1c5bbe 100644
--- a/src/declarative/extra/qfxparticles.cpp
+++ b/src/declarative/extra/qfxparticles.cpp
@@ -473,8 +473,9 @@ void QFxParticlesPrivate::tick(int time)
}
}
}
- while(particles.count() < count && particles.count() < percCount && streamWidth--)
- createParticle(time);
+ while(particles.count() < count &&
+ (!stream || (particles.count() < percCount && streamWidth--)))
+ createParticle(time);
}
lastAdvTime = time;
@@ -704,11 +705,13 @@ void QFxParticles::setCount(int cnt)
{
Q_D(QFxParticles);
if (cnt != d->count) {
- if (!d->count && d->clock.state() != QAbstractAnimation::Running)
- d->clock.start(); // infinity??
+ int oldCount = d->count;
d->count = cnt;
d->addParticleTime = 0;
d->addParticleCount = d->particles.count();
+ if (!oldCount && d->clock.state() != QAbstractAnimation::Running){
+ d->clock.start(); // infinity??
+ }
update();
}
}