Merge pull request #63472 from timothyqiu/tree-row-cell-bg

Tree: Don't draw selection background of individual cells in Row mode
This commit is contained in:
Rémi Verschelde 2022-07-26 07:53:37 +02:00 committed by GitHub
commit c3dc887c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1849,15 +1849,16 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
p_item->set_meta("__focus_rect", Rect2(r.position, r.size)); p_item->set_meta("__focus_rect", Rect2(r.position, r.size));
if (rtl) { if (select_mode != SELECT_ROW) {
r.position.x = get_size().width - r.position.x - r.size.x; if (rtl) {
} r.position.x = get_size().width - r.position.x - r.size.x;
}
if (p_item->cells[i].selected) { if (p_item->cells[i].selected) {
if (has_focus()) { if (has_focus()) {
cache.selected_focus->draw(ci, r); cache.selected_focus->draw(ci, r);
} else { } else {
cache.selected->draw(ci, r); cache.selected->draw(ci, r);
}
} }
} }
} }