[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

@@ -239,7 +239,7 @@ void SumGraphController::LegendView::setSumSymbol(Step step, double start, doubl
} 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), KDFont::SmallFont),
EmptyLayout(EmptyLayoutNode::Color::Yellow, false, KDFont::SmallFont, false));
@@ -251,13 +251,13 @@ void SumGraphController::LegendView::setSumSymbol(Step step, double start, doubl
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), KDFont::SmallFont);
m_sumLayout = CondensedSumLayout(
m_sumLayout = CondensedSumLayout::Builder(
LayoutHelper::String(sigma, sizeof(sigma)),
start,
end);
strlcpy(buffer, "= ", bufferSize);
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), KDFont::SmallFont));