summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-24 18:05:44 +0200
committerGitHub <noreply@github.com>2019-09-24 18:05:44 +0200
commit0c3335d1f3e83c5a95ceb93bb84da776e3fb7e63 (patch)
tree1f7f206b2e1a776333737a442f90daad1ad1002a /scene/2d
parent2b628e5d5b1b955beb599199e681b38edb5394a4 (diff)
parentbc94203addfddfab386878125d98c52765d489ad (diff)
Merge pull request #32309 from clayjohn/particles_tex_scale
Fix particles scale randomization
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/cpu_particles_2d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index f9f273d494..6cd33e32af 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -866,8 +866,8 @@ void CPUParticles2D::_particles_process(float p_delta) {
}
//scale by scale
- float base_scale = Math::lerp(parameters[PARAM_SCALE] * tex_scale, 1.0f, p.scale_rand * randomness[PARAM_SCALE]);
- if (base_scale == 0.0) base_scale = 0.000001;
+ float base_scale = tex_scale * Math::lerp(parameters[PARAM_SCALE], 1.0f, p.scale_rand * randomness[PARAM_SCALE]);
+ if (base_scale < 0.000001) base_scale = 0.000001;
p.transform.elements[0] *= base_scale;
p.transform.elements[1] *= base_scale;