Skip to content

Commit b8250d1

Browse files
authored
Camera2D hotfix for equalize() (#2191)
1 parent 436aa78 commit b8250d1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arcade/camera/camera_2d.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
unproject_orthographic,
2020
)
2121
from arcade.gl import Framebuffer
22-
from arcade.types import LBWH, LRBT, Point, Rect
22+
from arcade.types import LBWH, LRBT, XYWH, Point, Rect
2323
from arcade.types.vector_like import Point2
2424
from arcade.window_commands import get_window
2525

@@ -752,7 +752,7 @@ def angle(self, value: float) -> None:
752752
"""
753753
_r = radians(value)
754754
# Note that this is flipped as we want 0 degrees to be vert.
755-
self._camera_data.position = (sin(_r), cos(_r), 0.0)
755+
self._camera_data.up = (-sin(_r), cos(_r), 0.0)
756756

757757
@property
758758
def zoom(self) -> float:
@@ -786,9 +786,8 @@ def equalise(self) -> None:
786786
When matching the projection to the viewport the method keeps
787787
the projections center in the same relative place.
788788
"""
789-
790-
self.width = self.viewport_width
791-
self.height = self.viewport_height
789+
x, y = self._projection_data.rect.x, self._projection_data.rect.y
790+
self._projection_data.rect = XYWH(x, y, self.viewport_width, self.viewport_height)
792791

793792
def match_screen(
794793
self, and_projection: bool = True, and_scissor: bool = True, and_position: bool = False

0 commit comments

Comments
 (0)