Added minimum scale for node 2D
This commit is contained in:
parent
7c00a875f7
commit
b7817c7b59
1 changed files with 2 additions and 2 deletions
|
@ -174,10 +174,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();
|
||||
|
|
Loading…
Reference in a new issue