summaryrefslogtreecommitdiff
path: root/scene/3d/decal.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-01 20:26:06 +0200
committerGitHub <noreply@github.com>2022-07-01 20:26:06 +0200
commit8c51b8246f6f11cbba75a971af34875ffe2facd0 (patch)
tree966f5d46add1255fae62116a2ef94e69ab54dea8 /scene/3d/decal.cpp
parentd8fe9ad8645494e298ae6b35ecb3162d3e85cf54 (diff)
parente7315fcc456571c42960b24bde481e04026295b4 (diff)
Merge pull request #62600 from Calinou/decal-fade-no-negative-values
Diffstat (limited to 'scene/3d/decal.cpp')
-rw-r--r--scene/3d/decal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp
index ab07f33ace..01cab493ec 100644
--- a/scene/3d/decal.cpp
+++ b/scene/3d/decal.cpp
@@ -72,7 +72,7 @@ real_t Decal::get_albedo_mix() const {
}
void Decal::set_upper_fade(real_t p_fade) {
- upper_fade = p_fade;
+ upper_fade = MAX(p_fade, 0.0);
RS::get_singleton()->decal_set_fade(decal, upper_fade, lower_fade);
}
@@ -81,7 +81,7 @@ real_t Decal::get_upper_fade() const {
}
void Decal::set_lower_fade(real_t p_fade) {
- lower_fade = p_fade;
+ lower_fade = MAX(p_fade, 0.0);
RS::get_singleton()->decal_set_fade(decal, upper_fade, lower_fade);
}