From b250660ee99b4085e0fbead0c8fbb359ca9e5ee6 Mon Sep 17 00:00:00 2001 From: Jason Lothamer Date: Fri, 5 Apr 2024 17:38:42 -0400 Subject: [PATCH] fix issue where Light2D does not re-attach itself to new canvas when viewport worlds are shared --- scene/2d/light_2d.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 79732d78618..5ce26b3ed49 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -203,7 +203,7 @@ void Light2D::_physics_interpolated_changed() { void Light2D::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: { + case NOTIFICATION_ENTER_CANVAS: { RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, get_canvas()); _update_light_visibility(); } break; @@ -227,7 +227,7 @@ void Light2D::_notification(int p_what) { } } break; - case NOTIFICATION_EXIT_TREE: { + case NOTIFICATION_EXIT_CANVAS: { RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, RID()); _update_light_visibility(); } break;