From c523749662dd8b41182efe279b52de9b6580fc99 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Tue, 19 Apr 2016 21:32:26 +0300 Subject: [PATCH] Fix Camera2D ignoring zoom when checking limits Closes #1912 (cherry picked from commit 7a8aea0be9186e9b47b28ca3d2999d7182a73d2b) --- scene/2d/camera_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 39d2367bc05..68d8b09e04d 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -144,7 +144,7 @@ Matrix32 Camera2D::get_camera_transform() { screen_offset = screen_offset.rotated(angle); } - Rect2 screen_rect(-screen_offset+ret_camera_pos,screen_size); + Rect2 screen_rect(-screen_offset+ret_camera_pos,screen_size*zoom); if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT]) screen_rect.pos.x = limit[MARGIN_RIGHT] - screen_rect.size.x;