[poincare/matrix_layout] Remove unneeded code

This commit is contained in:
Léa Saviot
2019-09-20 16:43:54 +02:00
committed by RubenNumworks
parent 6ef0b3b4ab
commit d17b74b440

View File

@@ -290,7 +290,6 @@ void MatrixLayoutNode::didReplaceChildAtIndex(int index, LayoutCursor * cursor,
assert(index >= 0 && index < m_numberOfColumns*m_numberOfRows);
int rowIndex = rowAtChildIndex(index);
int columnIndex = columnAtChildIndex(index);
bool rowIsEmpty = isRowEmpty(rowIndex);
bool columnIsEmpty = isColumnEmpty(columnIndex);
int newIndex = index;
if (columnIsEmpty && m_numberOfColumns > 2) {
@@ -298,14 +297,6 @@ void MatrixLayoutNode::didReplaceChildAtIndex(int index, LayoutCursor * cursor,
deleteColumnAtIndex(columnIndex);
newIndex -= rowIndex;
}
if (!rowIsEmpty && !columnIsEmpty) {
LayoutNode * newChild = childAtIndex(newIndex);
if (newChild->isEmpty()
&& (childIsRightOfGrid(index)|| childIsBottomOfGrid(index)))
{
static_cast<EmptyLayoutNode *>(newChild)->setColor(EmptyLayoutNode::Color::Grey);
}
}
if (cursor) {
assert(newIndex >= 0 && newIndex < m_numberOfColumns*m_numberOfRows);
cursor->setLayoutNode(childAtIndex(newIndex));