File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -232,16 +232,18 @@ def size(self, new_value: Point2):
232232 "size must be a tuple-like object which unpacks to exactly 2 coordinates"
233233 )
234234 old_size = self ._size
235- if old_size [0 ] != width or old_size [1 ] != height :
236- texture_size = self ._texture .size
237- new_size = Vec2 (width , height )
238- self ._scale = new_size / texture_size
239- self ._size = new_size
235+ if old_size [0 ] == width and old_size [1 ] == height :
236+ return
240237
241- self .update_spatial_hash ()
238+ texture_size = self ._texture .size
239+ new_size = Vec2 (width , height )
240+ self ._scale = new_size / texture_size
241+ self ._size = new_size
242242
243- for sprite_list in self .sprite_lists :
244- sprite_list ._update_size (self )
243+ self .update_spatial_hash ()
244+
245+ for sprite_list in self .sprite_lists :
246+ sprite_list ._update_size (self )
245247
246248 @property
247249 def scale_x (self ) -> float :
You can’t perform that action at this time.
0 commit comments