Items of size 0, with just one item, we'd hit the assert.

This commit is contained in:
matham 2016-07-21 22:30:13 -04:00 committed by GitHub
parent 76a20036d0
commit 46dd812666
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ class RecycleBoxLayout(RecycleLayout, BoxLayout):
x, y = pos
if self.orientation == 'horizontal':
if x >= calc_pos[-1]:
if x >= calc_pos[-1] or len(calc_pos) == 1:
return len(calc_pos) - 1
ix = 0
@ -145,7 +145,7 @@ class RecycleBoxLayout(RecycleLayout, BoxLayout):
return ix
ix += 1
else:
if y >= calc_pos[-1]:
if y >= calc_pos[-1] or len(calc_pos) == 1:
return 0
iy = 0