diff options
author | LikeLakers2 <1008889+LikeLakers2@users.noreply.github.com> | 2019-07-05 21:22:09 -0400 |
---|---|---|
committer | LikeLakers2 <1008889+LikeLakers2@users.noreply.github.com> | 2019-07-05 21:22:09 -0400 |
commit | 3f5db82a89460e1f80015b625b039aba875fd13f (patch) | |
tree | 1710b260d688150a9b40b03a66f2a05e32da50bb /scene | |
parent | d897131ac555de84afe9ca6845abf87c26957895 (diff) |
Camera2D's offset now ignores the limit property
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/camera_2d.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index a0d74dd283..6011941142 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -140,9 +140,6 @@ Transform2D Camera2D::get_camera_transform() { Point2 screen_offset = (anchor_mode == ANCHOR_MODE_DRAG_CENTER ? (screen_size * 0.5 * zoom) : Point2()); Rect2 screen_rect(-screen_offset + camera_pos, screen_size * zoom); - if (offset != Vector2()) - screen_rect.position += offset; - if (limit_smoothing_enabled) { if (screen_rect.position.x < limit[MARGIN_LEFT]) camera_pos.x -= screen_rect.position.x - limit[MARGIN_LEFT]; @@ -193,21 +190,8 @@ Transform2D Camera2D::get_camera_transform() { if (screen_rect.position.y < limit[MARGIN_TOP]) screen_rect.position.y = limit[MARGIN_TOP]; - if (offset != Vector2()) { - + if (offset != Vector2()) screen_rect.position += offset; - if (screen_rect.position.x + screen_rect.size.x > limit[MARGIN_RIGHT]) - screen_rect.position.x = limit[MARGIN_RIGHT] - screen_rect.size.x; - - if (screen_rect.position.y + screen_rect.size.y > limit[MARGIN_BOTTOM]) - screen_rect.position.y = limit[MARGIN_BOTTOM] - screen_rect.size.y; - - if (screen_rect.position.x < limit[MARGIN_LEFT]) - screen_rect.position.x = limit[MARGIN_LEFT]; - - if (screen_rect.position.y < limit[MARGIN_TOP]) - screen_rect.position.y = limit[MARGIN_TOP]; - } camera_screen_center = screen_rect.position + screen_rect.size * 0.5; |