mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[poincare] Fix cursor position when layout field is not editing
Change-Id: I39fa348a3e567621f4574b2e331b75a836353306
This commit is contained in:
committed by
EmilieNumworks
parent
05334823e5
commit
2e03812cdb
@@ -281,12 +281,17 @@ void ExpressionLayoutField::insertLayoutAtCursor(Poincare::ExpressionLayout * la
|
||||
bool layoutWillBeMerged = layout->isHorizontal();
|
||||
Poincare::ExpressionLayout * lastMergedLayoutChild = layoutWillBeMerged ? layout->editableChild(layout->numberOfChildren()-1) : nullptr;
|
||||
m_contentView.cursor()->addLayoutAndMoveCursor(layout);
|
||||
if (pointedLayout != nullptr && (pointedLayout != layout || !layoutWillBeMerged)) {
|
||||
m_contentView.cursor()->setPointedExpressionLayout(pointedLayout);
|
||||
m_contentView.cursor()->setPosition(Poincare::ExpressionLayoutCursor::Position::Right);
|
||||
} else if (!layoutWillBeMerged) {
|
||||
m_contentView.cursor()->setPointedExpressionLayout(layout->layoutToPointWhenInserting());
|
||||
if (!isEditing()) {
|
||||
m_contentView.cursor()->setPointedExpressionLayout(expressionLayout());
|
||||
m_contentView.cursor()->setPosition(Poincare::ExpressionLayoutCursor::Position::Right);
|
||||
} else {
|
||||
if (pointedLayout != nullptr && (pointedLayout != layout || !layoutWillBeMerged)) {
|
||||
m_contentView.cursor()->setPointedExpressionLayout(pointedLayout);
|
||||
m_contentView.cursor()->setPosition(Poincare::ExpressionLayoutCursor::Position::Right);
|
||||
} else if (!layoutWillBeMerged) {
|
||||
m_contentView.cursor()->setPointedExpressionLayout(layout->layoutToPointWhenInserting());
|
||||
m_contentView.cursor()->setPosition(Poincare::ExpressionLayoutCursor::Position::Right);
|
||||
}
|
||||
}
|
||||
m_contentView.cursor()->pointedExpressionLayout()->addGreySquaresToAllMatrixAncestors();
|
||||
m_contentView.cursor()->hideEmptyLayoutIfNeeded();
|
||||
|
||||
Reference in New Issue
Block a user