瀏覽代碼

Fix for smoothing camera2D when you change zoom, fix #2074.

Guilherme Felipe 10 年之前
父節點
當前提交
da895e8542
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/2d/camera_2d.cpp

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

@@ -57,7 +57,9 @@ void Camera2D::_update_scroll() {
 void Camera2D::set_zoom(const Vector2 &p_zoom) {
 
 	zoom = p_zoom;
+	Point2 old_smoothed_camera_pos = smoothed_camera_pos;
 	_update_scroll();
+	smoothed_camera_pos = old_smoothed_camera_pos;
 };
 
 Vector2 Camera2D::get_zoom() const {