From 6cb51544a24a40fe6ad5e374c7712624c8fa663f Mon Sep 17 00:00:00 2001 From: anxuae Date: Wed, 18 Aug 2021 08:07:52 +0200 Subject: [PATCH] Fix page click on same selection --- pygame_imslider/slider.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygame_imslider/slider.py b/pygame_imslider/slider.py index e3b25d8..cfe6d90 100755 --- a/pygame_imslider/slider.py +++ b/pygame_imslider/slider.py @@ -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')