Fix camera2d zoom when set to zero (causing ERROR: affine_invert: Condition ' det == 0 ' is true.)
Fixes: #41873
(cherry picked from commit aba477361d
)
This commit is contained in:
parent
8f5bdf6a63
commit
e0bdb19a62
1 changed files with 2 additions and 0 deletions
|
@ -78,6 +78,8 @@ void Camera2D::_update_process_mode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera2D::set_zoom(const Vector2 &p_zoom) {
|
void Camera2D::set_zoom(const Vector2 &p_zoom) {
|
||||||
|
// Setting zoom to zero causes 'affine_invert' issues
|
||||||
|
ERR_FAIL_COND_MSG(Math::is_zero_approx(p_zoom.x) || Math::is_zero_approx(p_zoom.y), "Zoom level must be different from 0 (can be negative).");
|
||||||
|
|
||||||
zoom = p_zoom;
|
zoom = p_zoom;
|
||||||
Point2 old_smoothed_camera_pos = smoothed_camera_pos;
|
Point2 old_smoothed_camera_pos = smoothed_camera_pos;
|
||||||
|
|
Loading…
Reference in a new issue