diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-01 08:52:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 08:52:08 +0200 |
commit | 719609522a30fa9e3b96b028ac5a1d1a65f1678f (patch) | |
tree | f7de417932b7cb8045f2f60505018207d7d61cc1 /scene | |
parent | 46b1b91da92e2a12594826a899945361136c1d1c (diff) | |
parent | 144a4cc39f037b6deba6095a342ede59d1afa8cb (diff) |
Merge pull request #40003 from YeldhamDev/tree_scroll_fix
Fix Tree's 'scroll_to_item()' not working correctly on some cases
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 7b9db7c081..34161a9e80 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3410,7 +3410,7 @@ void Tree::scroll_to_item(TreeItem *p_item) { const Rect2 r = get_item_rect(p_item); - if (r.position.y < v_scroll->get_value()) { + if (r.position.y <= v_scroll->get_value()) { v_scroll->set_value(r.position.y); } else if (r.position.y + r.size.y + 2 * cache.vseparation > v_scroll->get_value() + get_size().y) { v_scroll->set_value(r.position.y + r.size.y + 2 * cache.vseparation - get_size().y); |