diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-05-28 12:48:49 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2023-02-13 22:01:49 +0100 |
commit | 8b1de103a88e4298b94f2f3b63ce1469ef660684 (patch) | |
tree | d2194a1003e292421e28bd5e22262b18b2f5baa6 /scene/3d | |
parent | 853c36ca0b6a4b8982215115b1fb1b62b58f2d98 (diff) |
Clamp Decal size to positive values
This prevents using negative size, while also preventing
error messages from being spammed if one of the decal's dimensions
is set to exactly 0.
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/decal.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp index e122adcc8c..6f2717fd41 100644 --- a/scene/3d/decal.cpp +++ b/scene/3d/decal.cpp @@ -31,7 +31,7 @@ #include "decal.h" void Decal::set_size(const Vector3 &p_size) { - size = p_size; + size = Vector3(MAX(0.001, p_size.x), MAX(0.001, p_size.y), MAX(0.001, p_size.z)); RS::get_singleton()->decal_set_size(decal, p_size); update_gizmos(); } |