diff options
author | Jonathan Nicholl <jonathantnicholl@gmail.com> | 2022-09-01 20:32:33 -0400 |
---|---|---|
committer | Jonathan Nicholl <jonathantnicholl@gmail.com> | 2022-09-02 00:29:50 -0400 |
commit | 15d057c5211270605d4344165930bba9c5d7e2aa (patch) | |
tree | 04856ee92b23c5ea34cc39d708881796ca4cad8c /editor/plugins/tiles | |
parent | c6fd311da0d0052bb11237662ec528f9fab1b7dd (diff) |
Add `is_zero_approx` methods to `Vector2`, `3`, and `4`
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_data_editors.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 5f0576a675..d9291503cb 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -139,7 +139,7 @@ void TileAtlasView::_update_zoom_and_panning(bool p_zoom_on_mouse_pos) { // Center of panel. panning = panning * zoom / previous_zoom; } - button_center_view->set_disabled(panning.is_equal_approx(Vector2())); + button_center_view->set_disabled(panning.is_zero_approx()); previous_zoom = zoom; diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 1bfbd342c2..1dce41e4c7 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -448,7 +448,7 @@ void GenericTilePolygonEditor::_base_control_gui_input(Ref<InputEvent> p_event) } else if (drag_type == DRAG_TYPE_PAN) { panning += mm->get_position() - drag_last_pos; drag_last_pos = mm->get_position(); - button_center_view->set_disabled(panning.is_equal_approx(Vector2())); + button_center_view->set_disabled(panning.is_zero_approx()); } else { // Update hovered point. _grab_polygon_point(mm->get_position(), xform, hovered_polygon_index, hovered_point_index); |