Browse Source

Fixes ParallaxLayer offset when ignore camera zoom

(cherry picked from commit 5e2167631b3913ba8b34ff8c6c3d8027cb24ddf4)
Haoyu Qiu 5 years ago
parent
commit
fa81e3621f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/2d/parallax_background.cpp

+ 1 - 1
scene/2d/parallax_background.cpp

@@ -109,7 +109,7 @@ void ParallaxBackground::_update_scroll() {
 			continue;
 
 		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);
 	}