Преглед изворни кода

Fix ParallaxBackground breaking when moving it out the scene tree

(cherry picked from commit 359d7f178c9c64365355db10fa41492c903558b9)
Colin Redman пре 6 година
родитељ
комит
abf19bdab2
1 измењених фајлова са 5 додато и 0 уклоњено
  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;
 	}
 }