Skip to content

Commit

Permalink
Fix page click on same selection
Browse files Browse the repository at this point in the history
  • Loading branch information
anxuae committed Aug 18, 2021
1 parent d73bc62 commit 6cb5154
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pygame_imslider/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def set_index(self, index):
"""Set the current index."""
assert 0 <= index < len(self.layout.slides), "Invalid index '{}'".format(index)
current = self.layout.selection
if current == index:
return
self.layout.set_selection(pos=index)
if current < index:
self.layout.got_to_selection_forward(self.speed, self.focus == 'center')
Expand Down

0 comments on commit 6cb5154

Please sign in to comment.