Only use emitCap when we run into infinite particles
authorAlan Alpert <aalpert@blackberry.com>
Mon, 29 Apr 2013 20:21:10 +0000 (13:21 -0700)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 4 May 2013 04:26:22 +0000 (06:26 +0200)
commit6961ea8567f84acdc91007678746146b98e5d461
tree148f0ec7e39119351a0e4ebccee80eb660fa19a6
parent209c87d2bc188ee0f5be6b9562593169740eaddb
Only use emitCap when we run into infinite particles

emitCap is intended to prevent issues with multiple emission of infinite
life particles, but it can currently prevent emission of any particles
when particleCount() changes after a reset. Tracking particleCount() on
changes would be inefficient and be more work to integrate with the
correct behavior of infinite particles, so this patch delays the impact
of emitCap until an infinite particle is discovered.

This will lead to a subtle behavior difference of limiting infinite
particle counts based on the count at the first emission, not the first
reset, which could be construed as a bug fix in some situations. This
seems reasonable as a futher subtle behavior change will be needed in
the future to properly support varying counts of infinite particles.

Task-number: QTBUG-30915
Change-Id: I4172aee1d03f00cc63ce7c9d12ace052bc41436d
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
src/particles/qquickparticleemitter.cpp