Browse Source

Merge pull request #28684 from credman0/master

Fix ParallaxBackground breaking when moving it out the scene tree
Rémi Verschelde 6 năm trước cách đây
mục cha
commit
5128430700
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      scene/2d/parallax_layer.cpp

+ 5 - 0
scene/2d/parallax_layer.cpp

@@ -105,6 +105,11 @@ void ParallaxLayer::_notification(int p_what) {
 			orig_scale = get_scale();
 			_update_mirroring();
 		} break;
+		case NOTIFICATION_EXIT_TREE: {
+
+			set_position(orig_offset);
+			set_scale(orig_scale);
+		} break;
 	}
 }