[poincare] Fix HorizontalLayoutRef::mergeChildrenAtIndex

This commit is contained in:
Léa Saviot
2018-07-12 16:40:18 +02:00
parent 0f502e505a
commit 004e2d5d60

View File

@@ -404,8 +404,8 @@ void HorizontalLayoutRef::mergeChildrenAtIndex(HorizontalLayoutRef h, int index,
LayoutRef nextPointedLayout(nullptr);
LayoutCursor::Position nextPosition = LayoutCursor::Position::Left;
if (index < numberOfChildren()) {
nextPointedLayout = childAtIndex(index);
if (newIndex < numberOfChildren()) {
nextPointedLayout = childAtIndex(newIndex);
nextPosition = LayoutCursor::Position::Left;
} else {
nextPointedLayout = *this;