[apps/graph] Clean code in graph/graph_controller.cpp

This commit is contained in:
Léa Saviot
2018-12-04 10:11:26 +01:00
parent 37ac12b1da
commit 303ab7f009

View File

@@ -5,6 +5,8 @@ using namespace Shared;
namespace Graph {
static inline float max(float x, float y) { return (x>y ? x : y); }
GraphController::GraphController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, StorageCartesianFunctionStore * functionStore, Shared::InteractiveCurveViewRange * curveViewRange, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * modelVersion, uint32_t * rangeVersion, Poincare::Preferences::AngleUnit * angleUnitVersion, ButtonRowController * header) :
StorageFunctionGraphController(parentResponder, inputEventHandlerDelegate, header, curveViewRange, &m_view, cursor, indexFunctionSelectedByCursor, modelVersion, rangeVersion, angleUnitVersion),
m_bannerView(),
@@ -44,10 +46,10 @@ float GraphController::interestingXRange() {
ExpiringPointer<StorageCartesianFunction> f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));
float fRange = f->expressionReduced(myApp->localContext()).characteristicXRange(*(myApp->localContext()), Poincare::Preferences::sharedPreferences()->angleUnit());
if (!std::isnan(fRange)) {
characteristicRange = fRange > characteristicRange ? fRange : characteristicRange;
characteristicRange = max(fRange, characteristicRange);
}
}
return (characteristicRange > 0.0f ? 1.6f*characteristicRange : 10.0f);
return (characteristicRange > 0.0f ? 1.6f*characteristicRange : InteractiveCurveViewRangeDelegate::interestingXRange());
}
int GraphController::estimatedBannerNumberOfLines() const {