From 9a7c310134f4e645f80f79253c6ad3ae4d0a37ed Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 26 Jun 2016 16:51:13 -0300 Subject: [PATCH] Avoid mirroring to go negative to fix crash, closes #4036 (cherry picked from commit 10f411b47bd46fc28f780be9f70c20228ef4428c) --- scene/2d/parallax_layer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 7a898e43c9a..3bd93a05831 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -59,6 +59,11 @@ void ParallaxLayer::_update_mirroring() { void ParallaxLayer::set_mirroring(const Size2& p_mirroring) { mirroring=p_mirroring; + if (mirroring.x<0) + mirroring.x=0; + if (mirroring.y<0) + mirroring.y=0; + _update_mirroring(); }