mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare/matrix_layout] Keep median rows and columns
Empty columns and rows are only removed automatically when they are the last row/column. This way, the user can edit a median row/column without the matrix collapsing. Change-Id: If611fa0133f270d785809d433ae879879b6b093f
This commit is contained in:
committed by
LeaNumworks
parent
62e2a71da1
commit
7184202a6e
@@ -318,12 +318,12 @@ void MatrixLayoutNode::didReplaceChildAtIndex(int index, LayoutCursor * cursor,
|
||||
int columnIndex = columnAtChildIndex(index);
|
||||
bool columnIsEmpty = isColumnEmpty(columnIndex);
|
||||
int newIndex = index;
|
||||
if (columnIsEmpty && m_numberOfColumns > 2) {
|
||||
if (columnIsEmpty && m_numberOfColumns > 2 && columnIndex == m_numberOfColumns - 2) {
|
||||
// If the column is now empty, delete it
|
||||
deleteColumnAtIndex(columnIndex);
|
||||
newIndex -= rowIndex;
|
||||
}
|
||||
if (rowIsEmpty && m_numberOfRows > 2) {
|
||||
if (rowIsEmpty && m_numberOfRows > 2 && rowIndex == m_numberOfRows - 2) {
|
||||
// If the row is now empty, delete it
|
||||
deleteRowAtIndex(rowIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user