1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Improve use of Ref.is_null/valid

Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
A Thousand Ships
2024-08-25 14:15:10 +02:00
committed by AThousandShips
parent 0f95e9f8e6
commit a1846b27ea
177 changed files with 517 additions and 519 deletions

View File

@@ -459,7 +459,7 @@ void Sprite2DEditor::_debug_uv_draw() {
debug_uv->draw_set_transform(-draw_offset * draw_zoom, 0, Vector2(draw_zoom, draw_zoom));
Ref<Texture2D> tex = node->get_texture();
ERR_FAIL_COND(!tex.is_valid());
ERR_FAIL_COND(tex.is_null());
debug_uv->draw_texture(tex, Point2());
@@ -480,7 +480,7 @@ void Sprite2DEditor::_debug_uv_draw() {
void Sprite2DEditor::_center_view() {
Ref<Texture2D> tex = node->get_texture();
ERR_FAIL_COND(!tex.is_valid());
ERR_FAIL_COND(tex.is_null());
Vector2 zoom_factor = (debug_uv->get_size() - Vector2(1, 1) * 50 * EDSCALE) / tex->get_size();
zoom_widget->set_zoom(MIN(zoom_factor.x, zoom_factor.y));
// Recalculate scroll limits.
@@ -517,7 +517,7 @@ void Sprite2DEditor::_update_zoom_and_pan(bool p_zoom_at_center) {
}
Ref<Texture2D> tex = node->get_texture();
ERR_FAIL_COND(!tex.is_valid());
ERR_FAIL_COND(tex.is_null());
Point2 min_corner;
Point2 max_corner = tex->get_size();