diff --git a/apps/graph/list/type_parameter_controller.cpp b/apps/graph/list/type_parameter_controller.cpp index c6828058f..42990fc70 100644 --- a/apps/graph/list/type_parameter_controller.cpp +++ b/apps/graph/list/type_parameter_controller.cpp @@ -24,7 +24,7 @@ bool TypeParameterController::handleEvent(Ion::Events::Event event) { App * myApp = App::app(); assert(!m_record.isNull()); Shared::ExpiringPointer function = myApp->functionStore()->modelForRecord(m_record); - function->setPlotType(plotType); + function->setPlotType(plotType, Poincare::Preferences::sharedPreferences()->angleUnit()); StackViewController * stack = stackController(); stack->pop(); stack->pop(); diff --git a/apps/shared/cartesian_function.cpp b/apps/shared/cartesian_function.cpp index 2cdc0ce09..1e6dd6a9c 100644 --- a/apps/shared/cartesian_function.cpp +++ b/apps/shared/cartesian_function.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,7 @@ CartesianFunction::PlotType CartesianFunction::plotType() const { return recordData()->plotType(); } -void CartesianFunction::setPlotType(PlotType newPlotType) { +void CartesianFunction::setPlotType(PlotType newPlotType, Poincare::Preferences::AngleUnit angleUnit) { PlotType currentPlotType = plotType(); if (newPlotType == currentPlotType) { return; @@ -132,7 +133,7 @@ void CartesianFunction::setPlotType(PlotType newPlotType) { // Recompute the definition domain double tMin = newPlotType == PlotType::Cartesian ? -INFINITY : 0.0; - double tMax = newPlotType == PlotType::Cartesian ? INFINITY : 2.0*M_PI; + double tMax = newPlotType == PlotType::Cartesian ? INFINITY : 2.0*Trigonometry::PiInAngleUnit(angleUnit); setTMin(tMin); setTMax(tMax); diff --git a/apps/shared/cartesian_function.h b/apps/shared/cartesian_function.h index 1c5614fac..e7b95b692 100644 --- a/apps/shared/cartesian_function.h +++ b/apps/shared/cartesian_function.h @@ -27,7 +27,7 @@ public: Parametric = 2 }; PlotType plotType() const; - void setPlotType(PlotType plotType); + void setPlotType(PlotType plotType, Poincare::Preferences::AngleUnit angleUnit); static I18n::Message ParameterMessageForPlotType(PlotType plotType); // Evaluation