Merge pull request #35893 from KoBeWi/a_tree_pr

Calculate __focus_rect when TreeItem is focused
This commit is contained in:
Rémi Verschelde 2021-05-04 12:57:43 +02:00 committed by GitHub
commit ab09a62249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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); Rect2i r(cell_rect.position, cell_rect.size);
p_item->set_meta("__focus_rect", Rect2(r.position, r.size)); p_item->set_meta("__focus_rect", Rect2(r.position, r.size));