Skip to content

Commit 3663d70

Browse files
authored
add comment about vec2 operations in point_in_view (#2455)
1 parent 575d662 commit 3663d70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arcade/camera/camera_2d.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ def point_in_view(self, point: Point2) -> bool:
482482
Take a 2D point in the world, and return whether the point is inside the
483483
visible area of the camera.
484484
"""
485+
# This is unwrapped from standard Vec2 operations,
486+
# The construction and garbage collection of the vectors would
487+
# increase this method's cost by ~4x
488+
485489
pos = self.position
486490
diff = point[0] - pos[0], point[1] - pos[1]
487491

0 commit comments

Comments
 (0)