From 46dd81266632bde8bcfc798ab72213b7e22476c0 Mon Sep 17 00:00:00 2001 From: matham Date: Thu, 21 Jul 2016 22:30:13 -0400 Subject: [PATCH] Items of size 0, with just one item, we'd hit the assert. --- kivy/uix/recycleboxlayout.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kivy/uix/recycleboxlayout.py b/kivy/uix/recycleboxlayout.py index 516a68021..2db09ecb2 100644 --- a/kivy/uix/recycleboxlayout.py +++ b/kivy/uix/recycleboxlayout.py @@ -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