diff options
Diffstat (limited to 'scene/3d/particles.cpp')
-rw-r--r-- | scene/3d/particles.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index c291aa33ed..edf97bc248 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -1052,16 +1052,11 @@ float ParticlesMaterial::get_param_randomness(Parameter p_param) const { static void _adjust_curve_range(const Ref<Texture> &p_texture, float p_min, float p_max) { - Ref<CurveTexture> curve = p_texture; - if (!curve.is_valid()) + Ref<CurveTexture> curve_tex = p_texture; + if (!curve_tex.is_valid()) return; - if (curve->get_max() == 1.0) { - curve->set_max(p_max); - } - if (curve->get_min() == 0.0) { - curve->set_min(p_min); - } + curve_tex->ensure_default_setup(p_min, p_max); } void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture> &p_texture) { |