ソースを参照

Avoid mirroring to go negative to fix crash, closes #4036

Juan Linietsky 9 年 前
コミット
10f411b47b
1 ファイル変更5 行追加0 行削除
  1. 5 0
      scene/2d/parallax_layer.cpp

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

@@ -85,6 +85,11 @@ void ParallaxLayer::_update_mirroring() {
 void ParallaxLayer::set_mirroring(const Size2& p_mirroring) {
 void ParallaxLayer::set_mirroring(const Size2& p_mirroring) {
 
 
 	mirroring=p_mirroring;
 	mirroring=p_mirroring;
+	if (mirroring.x<0)
+		mirroring.x=0;
+	if (mirroring.y<0)
+		mirroring.y=0;
+
 	_update_mirroring();
 	_update_mirroring();
 
 
 }
 }