[poincare/matrix_layout] Do not delete on last line

This commit is contained in:
Léa Saviot
2019-09-23 10:12:47 +02:00
committed by EmilieNumworks
parent 80858d7c82
commit 7ab5250db9

View File

@@ -100,7 +100,7 @@ void MatrixLayoutNode::deleteBeforeCursor(LayoutCursor * cursor) {
int indexOfPointedLayout = indexOfChild(pointedChild);
if (columnAtChildIndex(indexOfPointedLayout) == 0) {
int rowIndex = rowAtChildIndex(indexOfPointedLayout);
if (isRowEmpty(rowIndex) && m_numberOfRows > 2) {
if (rowIndex < m_numberOfRows - 1 && isRowEmpty(rowIndex) && m_numberOfRows > 2) {
deleteRowAtIndex(rowIndex);
assert(indexOfPointedLayout >= 0 && indexOfPointedLayout < m_numberOfColumns*m_numberOfRows);
cursor->setLayoutNode(childAtIndex(indexOfPointedLayout));