[poincare] Fix SequenceToolbox special cells display when scrolling

When scrolling from "v(n+1)" to "abs(x)", the "v(n+1)" cell disappeared
This commit is contained in:
Léa Saviot
2018-07-18 17:25:11 +02:00
committed by LeaNumworks
parent 0bfe78e568
commit 5b67269e72

View File

@@ -54,9 +54,11 @@ HighlightCell * SequenceToolbox::reusableCell(int index, int type) {
}
void SequenceToolbox::willDisplayCellForIndex(HighlightCell * cell, int index) {
if (typeAtLocation(0, index) != 2) {
MathToolbox::willDisplayCellForIndex(cell, mathToolboxIndex(index));
if (typeAtLocation(0, index) == 2) {
static_cast<ExpressionTableCell *>(cell)->setExpressionLayout(m_addedCellLayout[index]);
return;
}
MathToolbox::willDisplayCellForIndex(cell, mathToolboxIndex(index));
}
int SequenceToolbox::typeAtLocation(int i, int j) {
@@ -105,9 +107,6 @@ void SequenceToolbox::setExtraCells(const char * sequenceName, int recurrenceDep
new VerticalOffsetLayout(LayoutEngine::createStringLayout(indice, strlen(indice), KDText::FontSize::Small), VerticalOffsetLayout::Type::Subscript, false),
false);
}
for (int index = 0; index < k_maxNumberOfDisplayedRows; index++) {
m_addedCells[index].setExpressionLayout(m_addedCellLayout[index]);
}
}
bool SequenceToolbox::selectAddedCell(int selectedRow){