File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -239,16 +239,18 @@ def size(self, new_value: Point2):
239
239
"size must be a tuple-like object which unpacks to exactly 2 coordinates"
240
240
)
241
241
old_size = self ._size
242
- if old_size [0 ] != width or old_size [1 ] != height :
243
- texture_size = self ._texture .size
244
- new_size = Vec2 (width , height )
245
- self ._scale = new_size / texture_size
246
- self ._size = new_size
242
+ if old_size [0 ] == width and old_size [1 ] == height :
243
+ return
247
244
248
- self .update_spatial_hash ()
245
+ texture_size = self ._texture .size
246
+ new_size = Vec2 (width , height )
247
+ self ._scale = new_size / texture_size
248
+ self ._size = new_size
249
249
250
- for sprite_list in self .sprite_lists :
251
- sprite_list ._update_size (self )
250
+ self .update_spatial_hash ()
251
+
252
+ for sprite_list in self .sprite_lists :
253
+ sprite_list ._update_size (self )
252
254
253
255
@property
254
256
def scale_x (self ) -> float :
You can’t perform that action at this time.
0 commit comments