[escher] Fix Layout reload

The layout should be reloaded when inserting a non-parsable layout in a
layout field.
This fixes "diff" insertion from the math toolbox in calculation
This commit is contained in:
Léa Saviot
2018-10-11 17:16:54 +02:00
committed by Émilie Feral
parent da226f7861
commit a2a31f7a47

View File

@@ -119,7 +119,9 @@ bool LayoutField::handleEventWithText(const char * text, bool indentation, bool
} else {
Expression resultExpression = Expression::parse(text);
if (resultExpression.isUninitialized()) {
KDSize previousLayoutSize = minimalSizeForOptimalDisplay();
m_contentView.cursor()->insertText(text);
reload(previousLayoutSize);
} else {
Layout resultLayout = resultExpression.createLayout(Poincare::Preferences::sharedPreferences()->displayMode(), Poincare::PrintFloat::k_numberOfStoredSignificantDigits);
if (currentNumberOfLayouts + resultLayout.numberOfDescendants(true) >= k_maxNumberOfLayouts) {