From 92fa88a6e3fe0a82e78e6da57dcc27e82900cf27 Mon Sep 17 00:00:00 2001 From: DragonMoffon Date: Tue, 21 Jan 2025 01:12:24 +1300 Subject: [PATCH] HOTFIX: Handling Vec2's being False when x=0 y=0 Thank you @bunny-therapist for finding this bug, and sorry it took so long to find. --- arcade/camera/camera_2d.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arcade/camera/camera_2d.py b/arcade/camera/camera_2d.py index 3dedb3856a..a20936ef9e 100644 --- a/arcade/camera/camera_2d.py +++ b/arcade/camera/camera_2d.py @@ -135,9 +135,10 @@ def __init__( f"projection depth is 0 due to equal {near=}" f"and {far=} values" ) - _pos = position or (half_width, half_height) + pos_x = position[0] if position is not None else half_width + pos_y = position[1] if position is not None else half_height self._camera_data = CameraData( - position=(_pos[0], _pos[1], 0.0), + position=(pos_x, pos_y, 0.0), up=(up[0], up[1], 0.0), forward=(0.0, 0.0, -1.0), zoom=zoom, @@ -240,9 +241,9 @@ def from_camera_data( render_target=render_target, window=window, viewport=viewport, scissor=scissor ) - if camera_data: + if camera_data is not None: new_camera._camera_data = camera_data - if projection_data: + if projection_data is not None: new_camera._projection_data = projection_data return new_camera