mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 23:00:45 +01:00
[apps/graph] Clean code in graph/graph_controller.cpp
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user