浏览代码

Ensure changes to Camera2D's limits don't affect smoothed_camera_pos

Marcel Admiraal 3 年之前
父节点
当前提交
e61dc6bb04
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/2d/camera_2d.cpp

+ 2 - 0
scene/2d/camera_2d.cpp

@@ -439,7 +439,9 @@ void Camera2D::clear_current() {
 void Camera2D::set_limit(Side p_side, int p_limit) {
 	ERR_FAIL_INDEX((int)p_side, 4);
 	limit[p_side] = p_limit;
+	Point2 old_smoothed_camera_pos = smoothed_camera_pos;
 	_update_scroll();
+	smoothed_camera_pos = old_smoothed_camera_pos;
 }
 
 int Camera2D::get_limit(Side p_side) const {