From 2c79071d0764317416cc9bae39e8ae3dfd0d84f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 26 Jan 2018 14:44:39 +0100 Subject: [PATCH] [poincare] Fix bug in HorizontalLayout. Adding a brother should add it has a child, or merge it if the "brother" is an horizontal layout! Change-Id: I77e993ef2270fd1bf61599d688f3835feb8c0971 --- poincare/src/layout/horizontal_layout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poincare/src/layout/horizontal_layout.cpp b/poincare/src/layout/horizontal_layout.cpp index 815161b80..e9285e151 100644 --- a/poincare/src/layout/horizontal_layout.cpp +++ b/poincare/src/layout/horizontal_layout.cpp @@ -367,11 +367,11 @@ void HorizontalLayout::privateAddBrother(ExpressionLayoutCursor * cursor, Expres cursor->setPosition(ExpressionLayoutCursor::Position::Right); } } - addChildAtIndex(brother, 0); + addOrMergeChildAtIndex(brother, 0, false); return; } assert(cursor->position() == ExpressionLayoutCursor::Position::Right); - addChildAtIndex(brother, numberOfChildren()); + addOrMergeChildAtIndex(brother, numberOfChildren(), false); if (moveCursor) { cursor->setPointedExpressionLayout(this); }