From 004e2d5d60beb3591f769972ef0dd8ba6aea0451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 12 Jul 2018 16:40:18 +0200 Subject: [PATCH] [poincare] Fix HorizontalLayoutRef::mergeChildrenAtIndex --- poincare/src/horizontal_layout_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poincare/src/horizontal_layout_node.cpp b/poincare/src/horizontal_layout_node.cpp index bdfa8d9b2..7ac7cf111 100644 --- a/poincare/src/horizontal_layout_node.cpp +++ b/poincare/src/horizontal_layout_node.cpp @@ -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;