diff options
author | JestemStefan <37214990+JestemStefan@users.noreply.github.com> | 2021-07-11 07:53:14 +0200 |
---|---|---|
committer | JestemStefan <pudipudi2x@gmail.com> | 2021-07-12 11:55:58 +0200 |
commit | f84ae146f026ae60d417eda97ec6fe7afb0052fe (patch) | |
tree | 9eebecf6f240f893bb141f9c69909c5d00c65fb4 | |
parent | 374ffbe2d2a7294dd9ea1429a3dec1eedfa34b60 (diff) |
Limit scale of node2D to EPSILON 0.00001 to prevent det==0 bug
-rw-r--r-- | scene/2d/node_2d.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 6fd383ddab..a744ef40f6 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -170,10 +170,10 @@ void Node2D::set_scale(const Size2 &p_scale) { } _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(); |