Skip to content

Commit 2af91d0

Browse files
committed
Correcting references to viewport
Thanks for point out the issue @eruvanos!
1 parent 1cff941 commit 2af91d0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎arcade/camera/default.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,19 @@ def use(self) -> None:
121121
cache's the window viewport to determine the projection matrix.
122122
"""
123123

124+
viewport = self.viewport.viewport
124125
# If the viewport is correct and the default camera is in use,
125126
# then don't waste time resetting the view and projection matrices
126-
if self._ctx.viewport == self.viewport.viewport and self._ctx.current_camera == self:
127+
if self._ctx.viewport == viewport and self._ctx.current_camera == self:
127128
return
128129

129130
# If the viewport has changed while the default camera is active then the
130131
# default needs to update itself.
131132
# If it was another camera's viewport being used the default camera should not update.
132-
if self._ctx.viewport != self.viewport and self._ctx.current_camera == self:
133+
if self._ctx.viewport != viewport and self._ctx.current_camera == self:
133134
self.viewport = LBWH(*self._ctx.viewport)
134135
else:
135-
self._ctx.viewport = self.viewport.viewport
136+
self._ctx.viewport = viewport
136137

137138
self._ctx.current_camera = self
138139

0 commit comments

Comments
 (0)