mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher/layout_field] Fix cursor position when inserting layout
Scenario : In calculation, write 10/7, enter Go up, press OK on 10/7 -> the cursor is not on the right of the layout
This commit is contained in:
@@ -310,8 +310,9 @@ void LayoutField::insertLayoutAtCursor(Layout layoutR, Poincare::Expression corr
|
||||
|
||||
/* Move the cursor if needed.
|
||||
*
|
||||
* If forceCursorRightOfLayout is true, there is no need to move the cursor
|
||||
* because it already points to the right of the added layout.
|
||||
* If forceCursorRightOfLayout is true and the layout has been merged, there
|
||||
* is no need to move the cursor because it already points to the right of the
|
||||
* added layouts.
|
||||
*
|
||||
* If the layout to point to has been merged, only its children have been
|
||||
* inserted in the layout. We already computed where the cursor should point,
|
||||
@@ -342,6 +343,9 @@ void LayoutField::insertLayoutAtCursor(Layout layoutR, Poincare::Expression corr
|
||||
assert(!cursorMergedLayout.isUninitialized());
|
||||
m_contentView.cursor()->setLayout(cursorMergedLayout);
|
||||
m_contentView.cursor()->setPosition(LayoutCursor::Position::Right);
|
||||
} else if (!layoutWillBeMerged) {
|
||||
m_contentView.cursor()->setLayout(layoutR);
|
||||
m_contentView.cursor()->setPosition(LayoutCursor::Position::Right);
|
||||
}
|
||||
|
||||
// Handle matrices
|
||||
|
||||
Reference in New Issue
Block a user