diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-05-14 21:19:23 -0600 |
---|---|---|
committer | LightningAA <50304111+LightningAA@users.noreply.github.com> | 2021-05-31 17:14:57 -1000 |
commit | 6d5b5ba89faf32ad73cf9b1752281b61a13b1538 (patch) | |
tree | 0042878bd47f77e33f3ab376a46480df7a3c49fa /editor | |
parent | 6e3f47983cabb5f162eaec075d810f717985beda (diff) |
ScrollContainer: Expose `_ensure_focused_visible` to the API
Was renamed to `ensure_control_visible`
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 2b75144ac7..74eed8330d 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1470,16 +1470,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 { |