From be8e452285c460cd162838c6dfdf11c77f6ada93 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Tue, 18 Aug 2020 17:48:01 +0200 Subject: [PATCH] [poincare/layout_cursor] Fix cursor after Square When typing Square in 2D Edition mode, the cursor would not be repositionned correctly, leading to some issues : - Typing 2 POW 3, pressing RIGHT to return to the baseline, then typing POW again adds parentheses around 2^3, as is mathematically correct. Typing 2 SQUARE, then POW, would show 2^2^_, while the user really typed (2^2)^_. Change-Id: I29c01d964924907a1866490189ea56e40771521d --- poincare/src/layout_cursor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/poincare/src/layout_cursor.cpp b/poincare/src/layout_cursor.cpp index d77e152c3..17fc57fc5 100644 --- a/poincare/src/layout_cursor.cpp +++ b/poincare/src/layout_cursor.cpp @@ -177,6 +177,8 @@ void LayoutCursor::addEmptyPowerLayout() { void LayoutCursor::addEmptySquarePowerLayout() { VerticalOffsetLayout offsetLayout = VerticalOffsetLayout::Builder(CodePointLayout::Builder('2'), VerticalOffsetLayoutNode::Position::Superscript); privateAddEmptyPowerLayout(offsetLayout); + m_layout = offsetLayout; + m_position = Position::Right; } void LayoutCursor::addEmptyTenPowerLayout() {