From 613d33efbaaf066cbf80b3de16ac7e071bfbcefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 17 Jan 2018 14:25:20 +0100 Subject: [PATCH] [poincare] Delete root layout if cursor left of the radicand. Change-Id: I42331f06785680053fa3cc64a95296697f207845 --- poincare/src/layout/nth_root_layout.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/poincare/src/layout/nth_root_layout.cpp b/poincare/src/layout/nth_root_layout.cpp index 77e4516ab..8c14bfe19 100644 --- a/poincare/src/layout/nth_root_layout.cpp +++ b/poincare/src/layout/nth_root_layout.cpp @@ -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; }