[apps/shared] CartesianFunction: fix tmin and tmax default values

depending on the plot type
This commit is contained in:
Émilie Feral
2019-08-29 15:17:38 +02:00
parent 638b655c58
commit 2827594616
2 changed files with 6 additions and 2 deletions

View File

@@ -109,6 +109,10 @@ CartesianFunction::PlotType CartesianFunction::plotType() const {
void CartesianFunction::setPlotType(PlotType plotType) {
/* Reset memoized layout. */
m_model.tidy();
double tMin = plotType == PlotType::Cartesian ? -INFINITY : 0.0;
double tMax = plotType == PlotType::Cartesian ? INFINITY : 360.0;
setTMin(tMin);
setTMax(tMax);
return recordData()->setPlotType(plotType);
}