aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/tree.cpp
diff options
context:
space:
mode:
authorPoommetee Ketson2017-08-26 23:55:43 +0700
committerPoommetee Ketson2017-08-26 23:55:43 +0700
commit5e889cce4f113410431278cd00aaea8c6c7366a3 (patch)
tree14204b429dea4a246cc7314b0c13bd44fd66678a /scene/gui/tree.cpp
parent1894157c9fab05984428d83a743b0fe1d720c80c (diff)
downloadgodot-5e889cce4f113410431278cd00aaea8c6c7366a3.tar.gz
godot-5e889cce4f113410431278cd00aaea8c6c7366a3.tar.zst
godot-5e889cce4f113410431278cd00aaea8c6c7366a3.zip
Diffstat (limited to 'scene/gui/tree.cpp')
-rw-r--r--scene/gui/tree.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 20bf818d4..38cd425a8 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2473,22 +2473,24 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
Point2 pos = b->get_position() - bg->get_offset();
cache.click_type = Cache::CLICK_NONE;
- if (show_column_titles && b->get_button_index() == BUTTON_LEFT) {
+ if (show_column_titles) {
pos.y -= _get_title_button_height();
if (pos.y < 0) {
- pos.x += cache.offset.x;
- int len = 0;
- for (int i = 0; i < columns.size(); i++) {
+ if (b->get_button_index() == BUTTON_LEFT) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
- len += get_column_width(i);
- if (pos.x < len) {
+ len += get_column_width(i);
+ if (pos.x < len) {
- cache.click_type = Cache::CLICK_TITLE;
- cache.click_index = i;
- //cache.click_id=;
- update();
- break;
+ cache.click_type = Cache::CLICK_TITLE;
+ cache.click_index = i;
+ //cache.click_id=;
+ update();
+ break;
+ }
}
}
break;