Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions arcade/camera/camera_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Loading