diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-09-24 15:23:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 15:23:24 +0200 |
commit | f87c75f77be4ca28db8afc516061640b12206ada (patch) | |
tree | 4f94d63e76c36ee5e515ba28a41a426871d94ed4 | |
parent | 6cb11cf41cfdaa0802aac7e1a49c0cccdfcd7e13 (diff) | |
parent | 5e2167631b3913ba8b34ff8c6c3d8027cb24ddf4 (diff) |
Merge pull request #41934 from timothyqiu/parallax-ignore-zoom
Fixes ParallaxLayer offset when camera zoom is ignored
-rw-r--r-- | scene/2d/parallax_background.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 416622e6d5..8c9432f2fa 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -101,7 +101,7 @@ void ParallaxBackground::_update_scroll() { } if (ignore_camera_zoom) { - l->set_base_offset_and_scale(ofs, 1.0, screen_offset); + l->set_base_offset_and_scale((ofs + screen_offset * (scale - 1)) / scale, 1.0, screen_offset); } else { l->set_base_offset_and_scale(ofs, scale, screen_offset); } |