From a07ab8015e99bde5e60b771cf8965b74a353596f Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Wed, 8 Apr 2020 21:34:53 -0400 Subject: [PATCH] [apps/calculation] Correct insert in fractions --- apps/calculation/expression_field.h | 5 ++++- escher/include/escher/expression_field.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/calculation/expression_field.h b/apps/calculation/expression_field.h index a7fe0e20e..284404628 100644 --- a/apps/calculation/expression_field.h +++ b/apps/calculation/expression_field.h @@ -7,7 +7,10 @@ namespace Calculation { class ExpressionField : public ::ExpressionField { public: - using ::ExpressionField::ExpressionField; + ExpressionField(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandler, TextFieldDelegate * textFieldDelegate, LayoutFieldDelegate * layoutFieldDelegate) : + ::ExpressionField(parentResponder, inputEventHandler, textFieldDelegate, layoutFieldDelegate) { + setLayoutInsertionCursorEvent(Ion::Events::Up); + } protected: bool handleEvent(Ion::Events::Event event) override; }; diff --git a/escher/include/escher/expression_field.h b/escher/include/escher/expression_field.h index bdbec1afa..a79da0bdb 100644 --- a/escher/include/escher/expression_field.h +++ b/escher/include/escher/expression_field.h @@ -25,6 +25,7 @@ public: bool isEmpty() const; bool inputViewHeightDidChange(); bool handleEventWithText(const char * text, bool indentation = false, bool forceCursorRightOfText = false); + void setLayoutInsertionCursorEvent(Ion::Events::Event event) { m_layoutField.setInsertionCursorEvent(event); } /* View */ int numberOfSubviews() const override { return 1; }