[poincare] Delete root layout if cursor left of the radicand.

Change-Id: I42331f06785680053fa3cc64a95296697f207845
This commit is contained in:
Léa Saviot
2018-01-17 14:25:20 +01:00
parent 169913b800
commit 613d33efba

View File

@@ -30,7 +30,15 @@ void NthRootLayout::backspaceAtCursor(ExpressionLayoutCursor * cursor) {
&& cursor->position() == ExpressionLayoutCursor::Position::Right)
{
// Case: Right.
// Delete the layout, keep the operand.
// Delete the layout, keep the radicand.
replaceWithAndMoveCursor(radicandLayout(), true, cursor);
return;
}
if (cursor->pointedExpressionLayout() == radicandLayout()
&& cursor->position() == ExpressionLayoutCursor::Position::Left)
{
// Case: Left of the radicand.
// Delete the layout, keep the radicand.
replaceWithAndMoveCursor(radicandLayout(), true, cursor);
return;
}