summaryrefslogtreecommitdiff
path: root/scene/2d/parallax_background.cpp
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2020-09-10 11:08:20 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2020-09-10 11:08:20 +0800
commit5e2167631b3913ba8b34ff8c6c3d8027cb24ddf4 (patch)
tree1f455d130a1a96f7d55ec082f560ef68d753cf71 /scene/2d/parallax_background.cpp
parentab7e7b8116be3f9c7e9a6ad9ef07c3c08936d8b6 (diff)
Fixes ParallaxLayer offset when ignore camera zoom
Diffstat (limited to 'scene/2d/parallax_background.cpp')
-rw-r--r--scene/2d/parallax_background.cpp2
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);
}