summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-07-26 09:58:49 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-07-26 10:09:11 +0800
commit6486d261aa235b4a7b053a2b35d6ae22abf5e96f (patch)
treea3926b6bce957138a8dd8a50d3c3225a60bf0c0a /scene
parent3e0e84a54c1c5666c32dbc2abd419b61e071ba33 (diff)
Tree: Don't draw selection background of individual cells in Row mode
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/tree.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 2c4cba4954..697286a80c 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1844,15 +1844,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));
- if (rtl) {
- r.position.x = get_size().width - r.position.x - r.size.x;
- }
-
- if (p_item->cells[i].selected) {
- if (has_focus()) {
- cache.selected_focus->draw(ci, r);
- } else {
- cache.selected->draw(ci, r);
+ if (select_mode != SELECT_ROW) {
+ if (rtl) {
+ r.position.x = get_size().width - r.position.x - r.size.x;
+ }
+ if (p_item->cells[i].selected) {
+ if (has_focus()) {
+ cache.selected_focus->draw(ci, r);
+ } else {
+ cache.selected->draw(ci, r);
+ }
}
}
}