[apps] Factorize Shared::InteractiveCurveViewController methods

cursorBottomMarginRatio(), displayBottomMarginRatio(),
estimatedBannerHeight() and k_viewHeight moved to
Shared::InteractiveCurveViewController from derived classes.

estimatedBannerNumberOfLines() moved from
Shared::FunctionGraphController to
Shared::InteractiveCurveViewController and implemented in
Regresssion::GraphController.
This commit is contained in:
Ruben Dashyan
2019-04-26 16:52:23 +02:00
committed by Émilie Feral
parent e32419ce63
commit d8f97d62a4
6 changed files with 25 additions and 41 deletions

View File

@@ -55,10 +55,6 @@ void FunctionGraphController::selectFunctionWithCursor(int functionIndex) {
*m_indexFunctionSelectedByCursor = functionIndex;
}
float FunctionGraphController::cursorBottomMarginRatio() {
return (curveView()->cursorView()->minimalSizeForOptimalDisplay().height()/2+estimatedBannerHeight())/k_viewHeight;
}
void FunctionGraphController::reloadBannerView() {
if (functionStore()->numberOfActiveFunctions() == 0) {
return;
@@ -67,14 +63,6 @@ void FunctionGraphController::reloadBannerView() {
reloadBannerViewForCursorOnFunction(m_cursor, record, functionStore(), functionStore()->symbol());
}
float FunctionGraphController::displayBottomMarginRatio() {
return (curveView()->cursorView()->minimalSizeForOptimalDisplay().height() + 2 + estimatedBannerHeight()) / k_viewHeight;
}
float FunctionGraphController::estimatedBannerHeight() const {
return BannerView::HeightGivenNumberOfLines(estimatedBannerNumberOfLines());
}
InteractiveCurveViewRangeDelegate::Range FunctionGraphController::computeYRange(InteractiveCurveViewRange * interactiveCurveViewRange) {
FunctionApp * myApp = static_cast<FunctionApp *>(app());
float min = FLT_MAX;