diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-26 16:51:13 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-26 16:51:13 -0300 |
commit | 10f411b47bd46fc28f780be9f70c20228ef4428c (patch) | |
tree | fafffd9447fad7f006169181f3d5692d6a456270 | |
parent | 8baa85d6b4428b3fcbcd7ef160e608471ea7606b (diff) |
Avoid mirroring to go negative to fix crash, closes #4036
-rw-r--r-- | scene/2d/parallax_layer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index ec7189ff93..e9378b1d02 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -85,6 +85,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(); } |