diff --git a/apps/graph/test/ranges.cpp b/apps/graph/test/ranges.cpp index 6e3952c41..85c6605df 100644 --- a/apps/graph/test/ranges.cpp +++ b/apps/graph/test/ranges.cpp @@ -20,8 +20,8 @@ public: // InteractiveCurveViewRangeDelegate bool defaultRangeIsNormalized() const override { return functionStore()->displaysNonCartesianFunctions(); } - void interestingRanges(InteractiveCurveViewRange * range) override { InterestingRangesHelper(range, context(), functionStore(), Ratio()); } - float addMargin(float x, float range, bool isVertical, bool isMin) override { return AddMarginHelper(x, range, isVertical, isMin, k_topMargin, k_bottomMargin, k_leftMargin, k_rightMargin); } + void interestingRanges(InteractiveCurveViewRange * range) override { DefaultInterestingRanges(range, context(), functionStore(), Ratio()); } + float addMargin(float x, float range, bool isVertical, bool isMin) override { return DefaultAddMargin(x, range, isVertical, isMin, k_topMargin, k_bottomMargin, k_leftMargin, k_rightMargin); } void updateZoomButtons() override {} private: diff --git a/apps/sequence/graph/curve_view_range.h b/apps/sequence/graph/curve_view_range.h index 42cef213c..8205a9139 100644 --- a/apps/sequence/graph/curve_view_range.h +++ b/apps/sequence/graph/curve_view_range.h @@ -10,7 +10,7 @@ public: CurveViewRange(Shared::InteractiveCurveViewRangeDelegate * delegate = nullptr); void normalize(bool forceChangeY = false) override; private: - virtual bool defaultRangeCriteria() const override { return false; } + virtual bool hasDefaultRange() const override { return false; } constexpr static float k_displayLeftMarginRatio = 0.1f; }; diff --git a/apps/shared/function_graph_controller.cpp b/apps/shared/function_graph_controller.cpp index 114687371..1f59575c3 100644 --- a/apps/shared/function_graph_controller.cpp +++ b/apps/shared/function_graph_controller.cpp @@ -155,7 +155,7 @@ int FunctionGraphController::numberOfCurves() const { void FunctionGraphController::interestingRanges(InteractiveCurveViewRange * range) { float ratio = InteractiveCurveViewRange::NormalYXRatio() / (1 + cursorTopMarginRatio() + cursorBottomMarginRatio()); - InterestingRangesHelper(range, textFieldDelegateApp()->localContext(), functionStore(), ratio); + DefaultInterestingRanges(range, textFieldDelegateApp()->localContext(), functionStore(), ratio); } } diff --git a/apps/shared/interactive_curve_view_controller.cpp b/apps/shared/interactive_curve_view_controller.cpp index 4373fed66..59492e4d0 100644 --- a/apps/shared/interactive_curve_view_controller.cpp +++ b/apps/shared/interactive_curve_view_controller.cpp @@ -41,7 +41,7 @@ InteractiveCurveViewController::InteractiveCurveViewController(Responder * paren } float InteractiveCurveViewController::addMargin(float y, float range, bool isVertical, bool isMin) { - return AddMarginHelper(y, range, isVertical, isMin, cursorTopMarginRatio(), cursorBottomMarginRatio(), cursorLeftMarginRatio(), cursorRightMarginRatio()); + return DefaultAddMargin(y, range, isVertical, isMin, cursorTopMarginRatio(), cursorBottomMarginRatio(), cursorLeftMarginRatio(), cursorRightMarginRatio()); } void InteractiveCurveViewController::updateZoomButtons() { diff --git a/apps/shared/interactive_curve_view_range.cpp b/apps/shared/interactive_curve_view_range.cpp index 8e2739a42..504356225 100644 --- a/apps/shared/interactive_curve_view_range.cpp +++ b/apps/shared/interactive_curve_view_range.cpp @@ -183,7 +183,7 @@ void InteractiveCurveViewRange::setDefault() { m_delegate->interestingRanges(this); /* If the horizontal bounds are integers, they are preset values and should * not be changed. */ - bool isDefaultRange = defaultRangeCriteria(); + bool isDefaultRange = hasDefaultRange(); // Add margins, then round limits. float newXMin = xMin(), newXMax = xMax(); diff --git a/apps/shared/interactive_curve_view_range.h b/apps/shared/interactive_curve_view_range.h index 52718eaac..dfde5c484 100644 --- a/apps/shared/interactive_curve_view_range.h +++ b/apps/shared/interactive_curve_view_range.h @@ -78,7 +78,7 @@ protected: * 2 * 1 unit -> 10.0mm * So normalizedYHalfRange = 43.2mm * 170/240 * 1 unit / 10.0mm */ constexpr static float NormalizedYHalfRange(float unit) { return 3.06f * unit; } - virtual bool defaultRangeCriteria() const { return (xMin() == std::round(xMin())) && (xMax() == std::round(xMax())); } + virtual bool hasDefaultRange() const { return (xMin() == std::round(xMin())) && (xMax() == std::round(xMax())); } InteractiveCurveViewRangeDelegate * m_delegate; private: diff --git a/apps/shared/interactive_curve_view_range_delegate.cpp b/apps/shared/interactive_curve_view_range_delegate.cpp index b82eb80bf..01ea2baf5 100644 --- a/apps/shared/interactive_curve_view_range_delegate.cpp +++ b/apps/shared/interactive_curve_view_range_delegate.cpp @@ -5,7 +5,7 @@ namespace Shared { -void InteractiveCurveViewRangeDelegate::InterestingRangesHelper(InteractiveCurveViewRange * range, Poincare::Context * context, FunctionStore * functionStore, float targetRatio) { +void InteractiveCurveViewRangeDelegate::DefaultInterestingRanges(InteractiveCurveViewRange * range, Poincare::Context * context, FunctionStore * functionStore, float targetRatio) { constexpr int maxLength = 10; float xMins[maxLength], xMaxs[maxLength], yMins[maxLength], yMaxs[maxLength]; int length = functionStore->numberOfActiveFunctions(); @@ -26,7 +26,7 @@ void InteractiveCurveViewRangeDelegate::InterestingRangesHelper(InteractiveCurve range->setYMax(yMax); } -float InteractiveCurveViewRangeDelegate::AddMarginHelper(float x, float range, bool isVertical, bool isMin, float top, float bottom, float left, float right) { +float InteractiveCurveViewRangeDelegate::DefaultAddMargin(float x, float range, bool isVertical, bool isMin, float top, float bottom, float left, float right) { /* The provided min or max range limit y is altered by adding a margin. * In pixels, the view's height occupied by the vertical range is equal to * viewHeight - topMargin - bottomMargin. diff --git a/apps/shared/interactive_curve_view_range_delegate.h b/apps/shared/interactive_curve_view_range_delegate.h index 8a163feaa..d21964000 100644 --- a/apps/shared/interactive_curve_view_range_delegate.h +++ b/apps/shared/interactive_curve_view_range_delegate.h @@ -13,8 +13,8 @@ class InteractiveCurveViewRangeDelegate { public: static constexpr float k_defaultXHalfRange = 10.0f; - static void InterestingRangesHelper(InteractiveCurveViewRange * range, Poincare::Context * context, FunctionStore * functionStore, float targetRatio); - static float AddMarginHelper(float x, float range, bool isVertical, bool isMin, float top, float bottom, float left, float right); + static void DefaultInterestingRanges(InteractiveCurveViewRange * range, Poincare::Context * context, FunctionStore * functionStore, float targetRatio); + static float DefaultAddMargin(float x, float range, bool isVertical, bool isMin, float top, float bottom, float left, float right); virtual float interestingXMin() const { return -k_defaultXHalfRange; } virtual bool defaultRangeIsNormalized() const { return false; }