mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[solver] Fix bug: when adding '=0' to an equation, force the cursor the
be at the end of the expression before adding '=0'
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user