mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01:00
[apps/graph] setDefault when changing models if non cartesian functions
This commit is contained in:
@@ -169,4 +169,8 @@ bool GraphController::displaysNonCartesianFunctions() const {
|
||||
|| store->numberOfActiveFunctionsOfType(CartesianFunction::PlotType::Parametric) > 0;
|
||||
}
|
||||
|
||||
bool GraphController::shouldSetDefaultOnModelChange() const {
|
||||
return displaysNonCartesianFunctions();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ private:
|
||||
bool displaysNonCartesianFunctions() const;
|
||||
bool defautRangeIsNormalized() const override { return displaysNonCartesianFunctions(); }
|
||||
void interestingFunctionRange(Shared::ExpiringPointer<Shared::CartesianFunction> f, float tMin, float tMax, float step, float * xm, float * xM, float * ym, float * yM) const;
|
||||
bool shouldSetDefaultOnModelChange() const override;
|
||||
|
||||
Shared::RoundCursorView m_cursorView;
|
||||
BannerView m_bannerView;
|
||||
|
||||
@@ -144,7 +144,7 @@ Responder * InteractiveCurveViewController::defaultController() {
|
||||
void InteractiveCurveViewController::viewWillAppear() {
|
||||
uint32_t newModelVersion = modelVersion();
|
||||
if (*m_modelVersion != newModelVersion) {
|
||||
if (*m_modelVersion == 0 || numberOfCurves() == 1) {
|
||||
if (*m_modelVersion == 0 || numberOfCurves() == 1 || shouldSetDefaultOnModelChange()) {
|
||||
interactiveCurveViewRange()->setDefault();
|
||||
}
|
||||
*m_modelVersion = newModelVersion;
|
||||
|
||||
@@ -64,6 +64,7 @@ private:
|
||||
// InteractiveCurveViewRangeDelegate
|
||||
float addMargin(float x, float range, bool isVertical, bool isMin) override;
|
||||
|
||||
virtual bool shouldSetDefaultOnModelChange() const { return false; }
|
||||
uint32_t * m_modelVersion;
|
||||
uint32_t * m_rangeVersion;
|
||||
RangeParameterController m_rangeParameterController;
|
||||
|
||||
Reference in New Issue
Block a user