Skip to content

Commit b857fe3

Browse files
committed
Add near/far validation to Camera2D.from_raw_data
1 parent b001919 commit b857fe3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arcade/camera/camera_2d.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ def from_raw_data(
139139
raise ZeroProjectionDimension((
140140
f"projection height is 0 due to equal {bottom=}"
141141
f"and {top=}"))
142+
if near == far:
143+
raise ZeroProjectionDimension(
144+
f"projection depth is 0 due to equal {near=}"
145+
f"and {far=} values"
146+
)
142147

143148
_pos = position or (half_width, half_height)
144149
_data = CameraData(

0 commit comments

Comments
 (0)