浏览代码

Merge pull request #41934 from timothyqiu/parallax-ignore-zoom

Fixes ParallaxLayer offset when camera zoom is ignored
Rémi Verschelde 5 年之前
父节点
当前提交
f87c75f77b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/2d/parallax_background.cpp

+ 1 - 1
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);
 		}