mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 19:49:58 +02:00
[graph] Fix Graph controllers to take a StorageCartesianFunction instead
of a CartesianFunction
This commit is contained in:
@@ -13,7 +13,7 @@ using namespace Poincare;
|
||||
namespace Graph {
|
||||
|
||||
IntegralGraphController::IntegralGraphController(Responder * parentResponder, GraphView * graphView, InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
|
||||
SumGraphController(parentResponder, graphView, graphRange, cursor, Ion::Charset::Integral)
|
||||
StorageSumGraphController(parentResponder, graphView, graphRange, cursor, Ion::Charset::Integral)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -36,10 +36,13 @@ double IntegralGraphController::cursorNextStep(double x, int direction) {
|
||||
return (direction > 0 ? x + m_graphRange->xGridUnit()/k_numberOfCursorStepsInGradUnit : x - m_graphRange->xGridUnit()/k_numberOfCursorStepsInGradUnit);
|
||||
}
|
||||
|
||||
Layout IntegralGraphController::createFunctionLayout(const char * functionName) {
|
||||
char buffer[7] = "0(x)dx";
|
||||
buffer[0] = functionName[0];
|
||||
return LayoutHelper::String(buffer, strlen(buffer), KDFont::SmallFont);
|
||||
Layout IntegralGraphController::createFunctionLayout(StorageFunction * function) {
|
||||
constexpr size_t bufferSize = SymbolAbstract::k_maxNameSize+5; // f(x)dx
|
||||
char buffer[bufferSize];
|
||||
const char * dx = "dx";
|
||||
int numberOfChars = function->nameWithArgument(buffer, bufferSize-strlen(dx), 'x');
|
||||
strlcpy(buffer+numberOfChars, dx, bufferSize-numberOfChars);
|
||||
return LayoutHelper::String(buffer, strlen(buffer), KFont::SmallFont);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user