Skip to content

Commit c563f2b

Browse files
committed
fix viewport not respecting aspect ratio and redundant rect reaction
found this issue with unit tests hurra
1 parent d370cbd commit c563f2b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arcade/camera/camera_2d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def __init__(
134134
else:
135135
width = viewport.width
136136
height = viewport.width / aspect
137+
viewport = XYWH(viewport.x, viewport.y, width, height)
137138
half_width = width / 2
138139
half_height = height / 2
139140

@@ -172,7 +173,7 @@ def __init__(
172173
left=left, right=right, top=top, bottom=bottom, near=near, far=far
173174
)
174175

175-
self.viewport: Rect = viewport or LRBT(0, 0, width, height)
176+
self.viewport: Rect = viewport
176177
"""
177178
A rect which describes how the final projection should be mapped
178179
from unit-space. defaults to the size of the render_target or window

0 commit comments

Comments
 (0)