[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

@@ -43,9 +43,10 @@ void GraphController::setDisplayDerivativeInBanner(bool displayDerivative) {
float GraphController::interestingXHalfRange() const {
float characteristicRange = 0.0f;
Poincare::Context * context = textFieldDelegateApp()->localContext();
for (int i = 0; i < functionStore()->numberOfActiveFunctions(); i++) {
ExpiringPointer<CartesianFunction> f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));
float fRange = f->expressionReduced(app()->localContext()).characteristicXRange(*(app()->localContext()), Poincare::Preferences::sharedPreferences()->angleUnit());
float fRange = f->expressionReduced(context).characteristicXRange(*context, Poincare::Preferences::sharedPreferences()->angleUnit());
if (!std::isnan(fRange)) {
characteristicRange = maxFloat(fRange, characteristicRange);
}