[apps/reg] Fix window sizing: cursor appears even with big bannerview

This commit is contained in:
Léa Saviot
2018-07-10 11:56:02 +02:00
committed by Émilie Feral
parent b9992e5eb6
commit 68d915fb3e
22 changed files with 107 additions and 51 deletions

View File

@@ -11,12 +11,13 @@
namespace Shared {
class FunctionGraphController : public InteractiveCurveViewController, public InteractiveCurveViewRangeDelegate, public FunctionBannerDelegate {
class FunctionGraphController : public InteractiveCurveViewController, public FunctionBannerDelegate {
public:
FunctionGraphController(Responder * parentResponder, ButtonRowController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView, CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * modelVersion, uint32_t * rangeVersion, Poincare::Expression::AngleUnit * angleUnitVersion);
bool isEmpty() const override;
ViewController * initialisationParameterController() override;
void viewWillAppear() override;
protected:
constexpr static float k_cursorTopMarginRatio = 0.068f; // (cursorHeight/2)/graphViewHeight
constexpr static float k_cursorBottomMarginRatio = 0.15f; // (cursorHeight/2+bannerHeigh)/graphViewHeight
@@ -33,8 +34,11 @@ private:
constexpr static float k_displayTopMarginRatio = 0.09f;
constexpr static float k_displayBottomMarginRatio = 0.2f;
// InteractiveCurveViewController
float displayTopMarginRatio() override { return k_displayTopMarginRatio; }
float displayBottomMarginRatio() override { return k_displayBottomMarginRatio; }
// InteractiveCurveViewRangeDelegate
InteractiveCurveViewRangeDelegate::Range computeYRange(InteractiveCurveViewRange * interactiveCurveViewRange) override;
float addMargin(float x, float range, bool isMin) override;
void initRangeParameters() override;
void initCursorParameters() override;