Make CanvasModulate deactivate when hidden, fixes #2437
This commit is contained in:
parent
810f049edf
commit
b78c1e52c2
|
@ -5,10 +5,19 @@ void CanvasModulate::_notification(int p_what) {
|
|||
|
||||
if (p_what==NOTIFICATION_ENTER_CANVAS) {
|
||||
|
||||
if (is_visible())
|
||||
VS::get_singleton()->canvas_set_modulate(get_canvas(),color);
|
||||
} else if (p_what==NOTIFICATION_EXIT_CANVAS) {
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue