summaryrefslogtreecommitdiff
path: root/scene/2d/light_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/light_2d.cpp')
-rw-r--r--scene/2d/light_2d.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index eb66265010..1bffaf8084 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -189,6 +189,10 @@ float Light2D::get_energy() const {
void Light2D::set_texture_scale(float p_scale) {
_scale = p_scale;
+ // Avoid having 0 scale values, can lead to errors in physics and rendering.
+ if (_scale == 0) {
+ _scale = CMP_EPSILON;
+ }
VS::get_singleton()->canvas_light_set_scale(canvas_light, _scale);
item_rect_changed();
}