Skip to content

Commit

Permalink
Replace variable re-assignment with local variable typed purely to Vec2
Browse files Browse the repository at this point in the history
  • Loading branch information
pushfoo committed Jul 26, 2024
1 parent 7da2557 commit d58a2bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arcade/sprite/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ def scale(self, new_scale: Point2 | AsFloat):
if scale_x == old_scale[0] and scale_y == old_scale[1]:
return

new_scale = Vec2(scale_x, scale_y)
self._hit_box.scale = new_scale
self._scale = new_scale
self._size = new_scale * self._texture.size
processed_scale: Vec2 = Vec2(scale_x, scale_y)
self._hit_box.scale = processed_scale
self._scale = processed_scale
self._size = processed_scale * self._texture.size

self.update_spatial_hash()
for sprite_list in self.sprite_lists:
Expand Down

0 comments on commit d58a2bd

Please sign in to comment.