Update Grapher.cpp

This commit is contained in:
Alfonso Gregory 2021-07-14 20:05:12 -04:00 committed by GitHub
commit 99c44f4ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,14 +231,10 @@ namespace GraphControl
{ {
return; return;
} }
bool keepCurrentView = true;
// If the equation has changed, the IsLineEnabled state is reset. // If the equation has changed, the IsLineEnabled state is reset.
// This checks if the equation has been reset and sets keepCurrentView to false in this case. // This checks if the equation has been reset and sets keepCurrentView to false in this case.
if (!equation->HasGraphError && !equation->IsValidated && equation->IsLineEnabled) const bool keepCurrentView = equation->HasGraphError || equation->IsValidated || !equation->IsLineEnabled)
{
keepCurrentView = false;
}
PlotGraph(keepCurrentView); PlotGraph(keepCurrentView);
} }