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:
@@ -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())
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user