diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-01 10:45:24 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-01 10:45:24 -0300 |
commit | 7879efc50b46fc06cb451e6c6758245b289d7d22 (patch) | |
tree | 6b8d15ce90c65ad4f43d70462a0a1241e2cd0668 /scene/2d/light_occluder_2d.cpp | |
parent | b78c1e52c2e5bf688760e8102344b1a65f9c3851 (diff) |
Make both lights and occluders stop working if hidden, fixes #2437
Diffstat (limited to 'scene/2d/light_occluder_2d.cpp')
-rw-r--r-- | scene/2d/light_occluder_2d.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 6ebd499f71..d98bed0ea3 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -93,12 +93,17 @@ void LightOccluder2D::_notification(int p_what) { VS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder,get_canvas()); VS::get_singleton()->canvas_light_occluder_set_transform(occluder,get_global_transform()); + VS::get_singleton()->canvas_light_occluder_set_enabled(occluder,is_visible()); } if (p_what==NOTIFICATION_TRANSFORM_CHANGED) { VS::get_singleton()->canvas_light_occluder_set_transform(occluder,get_global_transform()); } + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + VS::get_singleton()->canvas_light_occluder_set_enabled(occluder,is_visible()); + } if (p_what==NOTIFICATION_DRAW) { |