Skip to content

Commit

Permalink
Sychronize update method between groups
Browse files Browse the repository at this point in the history
  • Loading branch information
anxuae committed May 28, 2023
1 parent e446645 commit c628f6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pygame_imslider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from .slider import ImSlider, STYPE_SLIDE, STYPE_LOOP, STYPE_FADE
from .renderers import ImSliderRenderer

__version__ = '1.0.1'
__version__ = '1.0.2'
4 changes: 3 additions & 1 deletion pygame_imslider/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, size, stype=STYPE_SLIDE, per_page=1, per_move=0, focus=True,

self.set_size(*size)

# On Raspberry Pi, the time to update dirty sprites is long (120-180ms
# On Raspberry Pi, the time to update dirty sprites is long (200-300ms
# tested), increasing the treshold permits to avoid blitting full screen
# at each draw() call.
self.sprites.set_timing_threshold(600)
Expand Down Expand Up @@ -283,6 +283,8 @@ def update(self, events):
dt = self.clock.tick() / 1000 # Amount of seconds between each loop.
update_eraser = self.background.image is None
self.sprites.update(events, dt)
# Synchronize update method between groups
self.layout._use_update = self.sprites._use_update

if self.layout.is_animated():
self.layout.update(events, dt)
Expand Down

0 comments on commit c628f6a

Please sign in to comment.