diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-02-23 10:36:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-23 10:36:09 +0100 |
commit | a291c837f000bd8936bc9b67efe60734f255266d (patch) | |
tree | 05befbb5f3f983352c0dd039a0181f583a397c98 | |
parent | 76a8d6f15fae400c1ad667425b7cacd999055026 (diff) | |
parent | 52abab5aa7a98001808f6781860f23895ea3d6d7 (diff) |
Merge pull request #26157 from YeldhamDev/splitcont_update_check
Make 'SplitContainer' update drawing only if actually needs to
-rw-r--r-- | scene/gui/split_container.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index e947216a3a..e5d1844d39 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -167,14 +167,15 @@ void SplitContainer::_notification(int p_what) { case NOTIFICATION_MOUSE_EXIT: { mouse_inside = false; - update(); + if (get_constant("autohide")) + update(); } break; case NOTIFICATION_DRAW: { if (!_getch(0) || !_getch(1)) return; - if (collapsed || (!mouse_inside && get_constant("autohide"))) + if (collapsed || (!dragging && !mouse_inside && get_constant("autohide"))) return; if (dragger_visibility != DRAGGER_VISIBLE) @@ -248,7 +249,8 @@ void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) { if (mouse_inside != mouse_inside_state) { mouse_inside = mouse_inside_state; - update(); + if (get_constant("autohide")) + update(); } if (!dragging) |