From 86466737ff61ca58e1f74c2e3e96ec6ef4ba47ce Mon Sep 17 00:00:00 2001 From: JestemStefan <37214990+JestemStefan@users.noreply.github.com> Date: Sat, 10 Jul 2021 20:25:20 +0200 Subject: [PATCH] Added minimum scale for node 2D (cherry picked from commit b7817c7b59db5db5c1d4c4a96f15a36ad99c38c4) --- scene/2d/node_2d.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 11f6e98247a..ddf9dab54ec 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -174,10 +174,12 @@ void Node2D::set_scale(const Size2 &p_scale) { ((Node2D *)this)->_update_xform_values(); _scale = p_scale; // Avoid having 0 scale values, can lead to errors in physics and rendering. - if (_scale.x == 0) + if (Math::is_zero_approx(_scale.x)) { _scale.x = CMP_EPSILON; - if (_scale.y == 0) + } + if (Math::is_zero_approx(_scale.y)) { _scale.y = CMP_EPSILON; + } _update_transform(); _change_notify("scale"); }