From 5e2167631b3913ba8b34ff8c6c3d8027cb24ddf4 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 10 Sep 2020 11:08:20 +0800 Subject: [PATCH] Fixes ParallaxLayer offset when ignore camera zoom --- scene/2d/parallax_background.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 416622e6d54..8c9432f2fa0 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); }