Prevent the graph to pan/zoom in some cases (#897)

* prevent the graph to change ranges when hide/show an equation or change the trig unit

* make sure to not zoom/pan when we hide the last visible equation
This commit is contained in:
Rudy Huyn 2020-01-06 13:10:53 -08:00 committed by Pepe Rivera
parent 8357f5d5c5
commit 7aaeee934c
5 changed files with 45 additions and 43 deletions

View file

@ -71,21 +71,6 @@ void GraphingSettingsViewModel::InitRanges()
m_dontUpdateDisplayRange = false;
}
void GraphingSettingsViewModel::RefreshPosition()
{
if (HasError())
{
InitRanges();
}
else
{
if (m_Graph != nullptr)
{
m_Graph->SetDisplayRanges(m_XMinValue, m_XMaxValue, m_YMinValue, m_YMaxValue);
}
}
}
void GraphingSettingsViewModel::UpdateDisplayRange(bool XValuesModified)
{
if (m_Graph == nullptr || m_dontUpdateDisplayRange || HasError())

View file

@ -229,7 +229,6 @@ namespace CalculatorApp::ViewModel
RaisePropertyChanged(L"TrigModeRadians");
RaisePropertyChanged(L"TrigModeDegrees");
RaisePropertyChanged(L"TrigModeGradians");
RefreshPosition();
}
}
}
@ -248,7 +247,6 @@ namespace CalculatorApp::ViewModel
RaisePropertyChanged(L"TrigModeDegrees");
RaisePropertyChanged(L"TrigModeRadians");
RaisePropertyChanged(L"TrigModeGradians");
RefreshPosition();
}
}
}
@ -267,14 +265,12 @@ namespace CalculatorApp::ViewModel
RaisePropertyChanged(L"TrigModeGradians");
RaisePropertyChanged(L"TrigModeDegrees");
RaisePropertyChanged(L"TrigModeRadians");
RefreshPosition();
}
}
}
public:
void UpdateDisplayRange(bool XValuesModified);
void RefreshPosition();
public:
void SetGrapher(GraphControl::Grapher ^ grapher);