diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-01 10:33:02 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-01 10:33:02 -0300 |
commit | b78c1e52c2e5bf688760e8102344b1a65f9c3851 (patch) | |
tree | 0061377668dbd4ca53bded0e8dda180abc88a01f /scene | |
parent | 810f049edfdb0827bc3808da271f767cd860ed34 (diff) |
Make CanvasModulate deactivate when hidden, fixes #2437
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/canvas_modulate.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 82dd8012a5..77203a7110 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -5,10 +5,19 @@ void CanvasModulate::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_CANVAS) { - VS::get_singleton()->canvas_set_modulate(get_canvas(),color); + if (is_visible()) + VS::get_singleton()->canvas_set_modulate(get_canvas(),color); } else if (p_what==NOTIFICATION_EXIT_CANVAS) { - VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + if (is_visible()) + VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + } else if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + if (is_visible()) { + VS::get_singleton()->canvas_set_modulate(get_canvas(),color); + } else { + VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + } } } |