mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-30 11:38:26 -07:00
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:
parent
8357f5d5c5
commit
7aaeee934c
5 changed files with 45 additions and 43 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue