[sequence] Fix TermSumController with new Poincare API

This commit is contained in:
Émilie Feral
2018-09-06 15:14:43 +02:00
parent dde781b06a
commit b6f977f894
2 changed files with 9 additions and 13 deletions

View File

@@ -2,10 +2,6 @@
#include "../../shared/text_field_delegate.h"
#include "../app.h"
#include "../../../poincare/src/layout/char_layout.h"
#include "../../../poincare/src/layout/horizontal_layout.h"
#include "../../../poincare/src/layout/vertical_offset_layout.h"
#include <cmath>
extern "C" {
@@ -50,14 +46,14 @@ double TermSumController::cursorNextStep(double x, int direction) {
return std::round(m_cursor->x()+delta);
}
ExpressionLayout * TermSumController::createFunctionLayout(const char * functionName) {
return new HorizontalLayout(
new CharLayout(functionName[0], KDText::FontSize::Small),
new VerticalOffsetLayout(
new CharLayout('n', KDText::FontSize::Small),
VerticalOffsetLayout::Type::Subscript,
false),
false);
LayoutReference TermSumController::createFunctionLayout(const char * functionName) {
return HorizontalLayoutRef(
CharLayoutRef(functionName[0], KDText::FontSize::Small),
VerticalOffsetLayoutRef(
CharLayoutRef('n', KDText::FontSize::Small),
VerticalOffsetLayoutNode::Type::Subscript
)
);
}
}

View File

@@ -16,7 +16,7 @@ private:
bool moveCursorHorizontallyToPosition(double position) override;
I18n::Message legendMessageAtStep(Step step) override;
double cursorNextStep(double position, int direction) override;
Poincare::ExpressionLayout * createFunctionLayout(const char * functionName) override;
Poincare::LayoutReference createFunctionLayout(const char * functionName) override;
};
}