Explicitly return None for negative event indices. Prior to this,
eventat(-1) would return the next-to-last event causing the back button to cycle back to the end of an event source instead of stopping at the start.
This commit is contained in:
parent
3083772f7f
commit
0410aaa991
@ -856,7 +856,7 @@ def ysize(self):
|
||||
return (Y_EVENTSOURCE)
|
||||
|
||||
def eventat(self, i):
|
||||
if (i >= len(self.events)):
|
||||
if (i >= len(self.events) or i < 0):
|
||||
return (None)
|
||||
event = self.events[i]
|
||||
return (event)
|
||||
|
Loading…
Reference in New Issue
Block a user