diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/project_manager.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 49a6d28dc1..8bde397b5c 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1484,16 +1484,7 @@ Vector<ProjectList::Item> ProjectList::get_selected_projects() const { void ProjectList::ensure_project_visible(int p_index) { const Item &item = _projects[p_index]; - - int item_top = item.control->get_position().y; - int item_bottom = item.control->get_position().y + item.control->get_size().y; - - if (item_top < get_v_scroll()) { - set_v_scroll(item_top); - - } else if (item_bottom > get_v_scroll() + get_size().y) { - set_v_scroll(item_bottom - get_size().y); - } + ensure_control_visible(item.control); } int ProjectList::get_single_selected_index() const { |