From 4a6724115c4d31312124022413a0689bebb67da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 11 Jun 2018 13:09:10 +0200 Subject: [PATCH] [solver] Fix bug: when adding '=0' to an equation, force the cursor the be at the end of the expression before adding '=0' --- apps/solver/list_controller.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/solver/list_controller.cpp b/apps/solver/list_controller.cpp index ba7c1f3d3..346d44b6a 100644 --- a/apps/solver/list_controller.cpp +++ b/apps/solver/list_controller.cpp @@ -115,6 +115,7 @@ bool textRepresentsAnEquality(const char * text) { bool ListController::textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) { if (textField->isEditing() && textField->textFieldShouldFinishEditing(event)) { if (!textRepresentsAnEquality(textField->text())) { + textField->handleEvent(Ion::Events::ShiftRight); textField->handleEventWithText("=0"); } } @@ -129,6 +130,7 @@ bool ListController::expressionLayoutFieldDidReceiveEvent(ExpressionLayoutField char buffer[TextField::maxBufferSize()]; expressionLayoutField->writeTextInBuffer(buffer, TextField::maxBufferSize()); if (!textRepresentsAnEquality(buffer)) { + expressionLayoutField->handleEvent(Ion::Events::ShiftRight); expressionLayoutField->handleEventWithText("=0"); } }