Updated Camera2D::set_zoom() function error message

Updated it so that the error condition is accurate to what the error description describes, and the editor won't be flooded with errors if you have a non-zero low zoom level.
This commit is contained in:
christopherdalmas 2024-09-20 20:49:43 +01:00 committed by GitHub
parent 621cadcf65
commit e71bdfa176
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,7 @@ void Camera2D::_update_process_callback() {
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).");
ERR_FAIL_COND_MSG(p_zoom.x == 0 || p_zoom.y == 0, "Zoom level must be different from 0 (can be negative).");
zoom = p_zoom;
zoom_scale = Vector2(1, 1) / zoom;