[apps/graph/values] Use Buffer text view in value cell class

Change-Id: Ib1d8d13a09bf4195f3ee9f2b266941fa996f9b8f
This commit is contained in:
Émilie Feral
2016-10-14 17:29:30 +02:00
parent 2a3cf5743a
commit 352277f0a9
3 changed files with 32 additions and 17 deletions

View File

@@ -210,12 +210,15 @@ void ValuesController::willDisplayCellAtLocation(View * cell, int i, int j) {
}
} else {
ValueCell * myCell = (ValueCell *)cell;
char buffer[14];
if (i == 0){
myCell->setFloat(m_interval.element(j-1));
Float(m_interval.element(j-1)).convertFloatToText(buffer, 14, 7);
myCell->setText(buffer);
} else {
Function * function = m_functionStore->activeFunctionAtIndex(i-1);
float x = m_interval.element(j-1);
myCell->setFloat(function->evaluateAtAbscissa(x, m_evaluateContext));
Float(function->evaluateAtAbscissa(x, m_evaluateContext)).convertFloatToText(buffer, 14, 7);
myCell->setText(buffer);
}
myCell->setEven(j%2 == 0);
}