diff options
| author | Haoyu Qiu <timothyqiu32@gmail.com> | 2024-08-27 11:49:27 +0800 |
|---|---|---|
| committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2024-08-27 11:49:27 +0800 |
| commit | d16dcbb3ac36db1c1e034ffbcf884f3a2a4d8086 (patch) | |
| tree | 8696fe66846aa324218f702e2fc85650d281282d /scene/gui | |
| parent | db76de5de8a415b29be4c7dd84b99bd0fe260822 (diff) | |
| download | redot-engine-d16dcbb3ac36db1c1e034ffbcf884f3a2a4d8086.tar.gz | |
Fix collapsing TreeItem not updating horizontal scrollbar
Diffstat (limited to 'scene/gui')
| -rw-r--r-- | scene/gui/tree.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 46fcdcf7f6..d19c79b2e2 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4495,9 +4495,16 @@ void Tree::item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mous } void Tree::item_changed(int p_column, TreeItem *p_item) { - if (p_item != nullptr && p_column >= 0 && p_column < p_item->cells.size()) { - p_item->cells.write[p_column].dirty = true; - columns.write[p_column].cached_minimum_width_dirty = true; + if (p_item != nullptr) { + if (p_column >= 0 && p_column < p_item->cells.size()) { + p_item->cells.write[p_column].dirty = true; + columns.write[p_column].cached_minimum_width_dirty = true; + } else if (p_column == -1) { + for (int i = 0; i < p_item->cells.size(); i++) { + p_item->cells.write[i].dirty = true; + columns.write[i].cached_minimum_width_dirty = true; + } + } } queue_redraw(); } |
