From a2a31f7a4766cc695d9c22d5cb9687feb668bb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 11 Oct 2018 17:16:54 +0200 Subject: [PATCH] [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 --- escher/src/layout_field.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index 6400e8562..51ade0327 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -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) {