[poincare] Clean Expression and Layout builders

Before: Opposite(Opposite(Rational(1))) misleadingly created the
expression "-1"; now, Opposite::Builder(Opposite::Builder(Rational(1)))
creates "--1"
This commit is contained in:
Émilie Feral
2019-01-28 17:44:08 +01:00
committed by LeaNumworks
parent b3d15d7e7f
commit ac6f23684d
113 changed files with 779 additions and 743 deletions

View File

@@ -240,7 +240,7 @@ void StorageSumGraphController::LegendView::setSumSymbol(Step step, double start
} else if (step == Step::SecondParameter) {
char buffer[PrintFloat::bufferSizeForFloatsWithPrecision(Constant::MediumNumberOfSignificantDigits)];
PrintFloat::convertFloatToText<double>(start, buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::MediumNumberOfSignificantDigits), Constant::MediumNumberOfSignificantDigits, Preferences::PrintFloatMode::Decimal);
m_sumLayout = CondensedSumLayout(
m_sumLayout = CondensedSumLayout::Builder(
LayoutHelper::String(sigma, sizeof(sigma)),
LayoutHelper::String(buffer, strlen(buffer), k_font),
EmptyLayout(EmptyLayoutNode::Color::Yellow, false, k_font, false));
@@ -251,13 +251,13 @@ void StorageSumGraphController::LegendView::setSumSymbol(Step step, double start
Layout start = LayoutHelper::String(buffer, strlen(buffer), KDFont::SmallFont);
PrintFloat::convertFloatToText<double>(end, buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Preferences::PrintFloatMode::Decimal);
Layout end = LayoutHelper::String(buffer, strlen(buffer), k_font);
m_sumLayout = CondensedSumLayout(
m_sumLayout = CondensedSumLayout::Builder(
LayoutHelper::String(sigma, sizeof(sigma)),
start,
end);
strlcpy(buffer, "= ", 3);
PoincareHelpers::ConvertFloatToText<double>(result, buffer+2, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits);
m_sumLayout = HorizontalLayout(
m_sumLayout = HorizontalLayout::Builder(
m_sumLayout,
functionLayout,
LayoutHelper::String(buffer, strlen(buffer), k_font));