Merge pull request #26157 from YeldhamDev/splitcont_update_check

Make 'SplitContainer' update drawing only if actually needs to
This commit is contained in:
Rémi Verschelde 2019-02-23 10:36:09 +01:00 committed by GitHub
commit a291c837f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -167,14 +167,15 @@ void SplitContainer::_notification(int p_what) {
case NOTIFICATION_MOUSE_EXIT: { case NOTIFICATION_MOUSE_EXIT: {
mouse_inside = false; mouse_inside = false;
update(); if (get_constant("autohide"))
update();
} break; } break;
case NOTIFICATION_DRAW: { case NOTIFICATION_DRAW: {
if (!_getch(0) || !_getch(1)) if (!_getch(0) || !_getch(1))
return; return;
if (collapsed || (!mouse_inside && get_constant("autohide"))) if (collapsed || (!dragging && !mouse_inside && get_constant("autohide")))
return; return;
if (dragger_visibility != DRAGGER_VISIBLE) if (dragger_visibility != DRAGGER_VISIBLE)
@ -248,7 +249,8 @@ void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) {
if (mouse_inside != mouse_inside_state) { if (mouse_inside != mouse_inside_state) {
mouse_inside = mouse_inside_state; mouse_inside = mouse_inside_state;
update(); if (get_constant("autohide"))
update();
} }
if (!dragging) if (!dragging)