only show on last member to improve performance

This commit is contained in:
Vin Minichino 2022-08-09 16:30:14 -04:00 committed by Vincent Minichino
parent ed8e0bafe2
commit e7e7e67e75

View file

@ -152,10 +152,18 @@ class AnimationGroup:
member.show()
return result
#improve performance of non-synced animations by only calling show on the last member
ret = False
pos = 1
num_members = len(self._members)
for item in self._members:
if item.animate(show):
ret = True
if pos == num_members:
if item.animate(show):
ret = True
else:
if item.animate(False):
ret = True
pos = pos + 1
return ret
@property