mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix smoothed camera position with limits
This commit is contained in:
parent
efb40c1524
commit
9a941441c4
1 changed files with 1 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ Transform2D Camera2D::get_camera_transform() {
|
|||
Rect2 screen_rect(-screen_offset + ret_camera_pos, screen_size * zoom_scale);
|
||||
|
||||
if (limit_enabled && (!position_smoothing_enabled || !limit_smoothing_enabled)) {
|
||||
Point2 bottom_right_corner = Point2(screen_rect.position + 2.0 * (camera_pos - screen_rect.position));
|
||||
Point2 bottom_right_corner = Point2(screen_rect.position + 2.0 * (ret_camera_pos - screen_rect.position));
|
||||
// Apply horizontal limiting.
|
||||
if (bottom_right_corner.x - screen_rect.position.x > limit[SIDE_RIGHT] - limit[SIDE_LEFT]) {
|
||||
// Split the difference horizontally (center it).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue