mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare][apps] Make preferences a const object accessible from
anywhere (poincare and apps) Change-Id: I49cc6bf940d1efeb6b153daac949ffcb23999a8d
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Shared {
|
||||
|
||||
Function::Function(const char * text, KDColor color) :
|
||||
@@ -25,7 +27,7 @@ void Function::setContent(const char * c) {
|
||||
}
|
||||
m_layout = nullptr;
|
||||
if (m_expression) {
|
||||
m_layout = expression()->createLayout();
|
||||
m_layout = expression()->createLayout(Expression::FloatDisplayMode::Decimal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,11 +70,11 @@ void Function::setActive(bool active) {
|
||||
m_active = active;
|
||||
}
|
||||
|
||||
float Function::evaluateAtAbscissa(float x, Poincare::Context * context, Poincare::Expression::AngleUnit angleUnit) const {
|
||||
float Function::evaluateAtAbscissa(float x, Poincare::Context * context) const {
|
||||
Poincare::Symbol xSymbol = Poincare::Symbol(symbol());
|
||||
Poincare::Complex e = Poincare::Complex(x);
|
||||
context->setExpressionForSymbolName(&e, &xSymbol);
|
||||
return m_expression->approximate(*context, angleUnit);
|
||||
return m_expression->approximate(*context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user