[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
This commit is contained in:
Léa Saviot
2018-01-26 14:44:39 +01:00
parent bc21aa919f
commit 2c79071d07

View File

@@ -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);
}