summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-04 12:57:43 +0200
committerGitHub <noreply@github.com>2021-05-04 12:57:43 +0200
commitab09a62249ffb7a25beb41734bc9ac619801fd97 (patch)
treed148928069ba87ae3cffb0924ab1839c2b70532b /scene/gui
parent74911e0d7abde3646e799de68d3775f92fb8ca79 (diff)
parent2035992a07c8a64189a7c5a4cbb2f03b6200fa6e (diff)
Merge pull request #35893 from KoBeWi/a_tree_pr
Calculate __focus_rect when TreeItem is focused
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tree.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 73fd9dbcd7..5fbf1bdb29 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1388,7 +1388,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
}
- if ((select_mode == SELECT_ROW && selected_item == p_item) || p_item->cells[i].selected) {
+ if ((select_mode == SELECT_ROW && selected_item == p_item) || p_item->cells[i].selected || !p_item->has_meta("__focus_rect")) {
Rect2i r(cell_rect.position, cell_rect.size);
p_item->set_meta("__focus_rect", Rect2(r.position, r.size));