Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eruvanos committed Jan 11, 2025
1 parent c4a0191 commit 504338c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arcade/camera/camera_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ def bottom_center(self) -> Vec2:
ux, uy, *_ = self._camera_data.up
bottom = self.bottom

return pos.x + ux * bottom, pos.y + uy * bottom # type: ignore
return Vec2(pos.x + ux * bottom, pos.y + uy * bottom)

@bottom_center.setter
def bottom_center(self, new_bottom: Point2):
Expand Down
9 changes: 7 additions & 2 deletions arcade/types/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from __future__ import annotations

from typing import NamedTuple, TypedDict
from typing import Any, NamedTuple, TypedDict

from pyglet.math import Vec3

Expand Down Expand Up @@ -352,12 +352,17 @@ def point_in_box(self, point: Point3) -> bool:
and (self.near <= z <= self.far)
)

def __contains__(self, point: Point3) -> bool:
def __contains__(self, point: Point3 | Any) -> bool:
"""Shorthand for :py:meth:`Box.point_in_box(point) <point_in_box>`.
Args:
point: A tuple of :py:class:`int` or :py:class:`float` values.
"""
from arcade.utils import is_iterable

if not is_iterable(point):
return False

return self.point_in_box(point)

def to_points(self) -> tuple[Vec3, Vec3, Vec3, Vec3, Vec3, Vec3, Vec3, Vec3]:
Expand Down
3 changes: 2 additions & 1 deletion arcade/types/rect.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from arcade.types.numbers import AsFloat
from arcade.types.vector_like import AnchorPoint, Point2
from arcade.utils import is_iterable

RectParams = tuple[AsFloat, AsFloat, AsFloat, AsFloat]
IntRectParams = tuple[int, int, int, int]
Expand Down Expand Up @@ -469,6 +468,8 @@ def __contains__(self, point: Point2 | Any) -> bool:
Args:
point: A tuple of :py:class:`int` or :py:class:`float` values.
"""
from arcade.utils import is_iterable

if not is_iterable(point):
return False

Expand Down

0 comments on commit 504338c

Please sign in to comment.