From d000a5fa308f0a1b81abc90cd60d1d1d3e2102b8 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 28 Jul 2022 12:06:45 +0100 Subject: [PATCH] Ensure changes to Camera2D's limits don't affect smoothed_camera_pos --- scene/2d/camera_2d.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 9898b7325a6..9dea44d72f6 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -436,7 +436,9 @@ void Camera2D::clear_current() { void Camera2D::set_limit(Margin p_margin, int p_limit) { ERR_FAIL_INDEX((int)p_margin, 4); limit[p_margin] = p_limit; + Point2 old_smoothed_camera_pos = smoothed_camera_pos; _update_scroll(); + smoothed_camera_pos = old_smoothed_camera_pos; } int Camera2D::get_limit(Margin p_margin) const {