[apps] Replace app() by textFieldDelegateApp() in TextFieldDelegates

This commit is contained in:
Ruben Dashyan
2019-07-18 18:14:33 +02:00
committed by EmilieNumworks
parent 28f713e905
commit 3e992a3560
13 changed files with 35 additions and 32 deletions

View File

@@ -61,12 +61,13 @@ float GraphController::interestingXHalfRange() const {
}
bool GraphController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
Shared::TextFieldDelegateApp * myApp = textFieldDelegateApp();
double floatBody;
if (app()->hasUndefinedValue(text, floatBody)) {
if (myApp->hasUndefinedValue(text, floatBody)) {
return false;
}
floatBody = std::fmax(0, std::round(floatBody));
double y = yValue(selectedCurveIndex(), floatBody, app()->localContext());
double y = yValue(selectedCurveIndex(), floatBody, myApp->localContext());
m_cursor->moveTo(floatBody, y);
interactiveCurveViewRange()->panToMakePointVisible(m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio);
reloadBannerView();
@@ -96,7 +97,7 @@ bool GraphController::moveCursorHorizontally(int direction) {
return false;
}
Sequence * s = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(indexFunctionSelectedByCursor()));
double y = s->evaluateAtAbscissa(x, app()->localContext());
double y = s->evaluateAtAbscissa(x, textFieldDelegateApp()->localContext());
m_cursor->moveTo(x, y);
return true;
}