summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authorkleonc <9283098+kleonc@users.noreply.github.com>2024-08-18 19:36:08 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-16 17:04:12 +0200
commitf0f69a7b7c44aff618f453b29f7ab69074790f28 (patch)
treece87c2531e857afbf4e8a076c471bad8471b93fc /scene
parent41682201696b29817abc935ca88edfbf9b60ccab (diff)
downloadredot-engine-f0f69a7b7c44aff618f453b29f7ab69074790f28.tar.gz
Fix Parallax2D repeats being not relative to its transform
(cherry picked from commit 1bd8372813d8a329188c05e8cc8c0c66f60b1735)
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/parallax_layer.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index dfe321a435..023e9201fc 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -78,13 +78,7 @@ 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;
- }
+ mirroring = p_mirroring.maxf(0);
_update_mirroring();
}