mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Change names: LayoutReference-->Layout
This commit is contained in:
@@ -202,7 +202,7 @@ bool SumGraphController::handleEnter() {
|
||||
|
||||
SumGraphController::LegendView::LegendView(SumGraphController * controller, char sumSymbol) :
|
||||
m_sum(0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_sumLayoutReference(),
|
||||
m_sumLayout(),
|
||||
m_legend(KDText::FontSize::Small, I18n::Message::Default, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_editableZone(controller, m_draftText, m_draftText, TextField::maxBufferSize(), controller, false, KDText::FontSize::Small, 0.0f, 0.5f, KDColorBlack, Palette::GreyMiddle),
|
||||
m_sumSymbol(sumSymbol)
|
||||
@@ -229,37 +229,37 @@ void SumGraphController::LegendView::setEditableZone(double d) {
|
||||
m_editableZone.setText(buffer);
|
||||
}
|
||||
|
||||
void SumGraphController::LegendView::setSumSymbol(Step step, double start, double end, double result, LayoutReference functionLayout) {
|
||||
void SumGraphController::LegendView::setSumSymbol(Step step, double start, double end, double result, Layout functionLayout) {
|
||||
assert(step == Step::Result || functionLayout.isUninitialized());
|
||||
const char sigma[] = {' ', m_sumSymbol};
|
||||
if (step == Step::FirstParameter) {
|
||||
m_sumLayoutReference = LayoutHelper::String(sigma, sizeof(sigma));
|
||||
m_sumLayout = LayoutHelper::String(sigma, sizeof(sigma));
|
||||
} 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_sumLayoutReference = CondensedSumLayoutReference(
|
||||
m_sumLayout = CondensedSumLayout(
|
||||
LayoutHelper::String(sigma, sizeof(sigma)),
|
||||
LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small),
|
||||
EmptyLayoutReference(EmptyLayoutNode::Color::Yellow, false, KDText::FontSize::Small, false));
|
||||
EmptyLayout(EmptyLayoutNode::Color::Yellow, false, KDText::FontSize::Small, false));
|
||||
} else {
|
||||
m_sumLayoutReference = LayoutHelper::String(sigma, sizeof(sigma));
|
||||
m_sumLayout = LayoutHelper::String(sigma, sizeof(sigma));
|
||||
char buffer[2+PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
|
||||
PrintFloat::convertFloatToText<double>(start, buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Preferences::PrintFloatMode::Decimal);
|
||||
LayoutReference start = LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small);
|
||||
Layout start = LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small);
|
||||
PrintFloat::convertFloatToText<double>(end, buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Preferences::PrintFloatMode::Decimal);
|
||||
LayoutReference end = LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small);
|
||||
m_sumLayoutReference = CondensedSumLayoutReference(
|
||||
Layout end = LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small);
|
||||
m_sumLayout = CondensedSumLayout(
|
||||
LayoutHelper::String(sigma, sizeof(sigma)),
|
||||
start,
|
||||
end);
|
||||
strlcpy(buffer, "= ", 3);
|
||||
PoincareHelpers::ConvertFloatToText<double>(result, buffer+2, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits);
|
||||
m_sumLayoutReference = HorizontalLayoutReference(
|
||||
m_sumLayoutReference,
|
||||
m_sumLayout = HorizontalLayout(
|
||||
m_sumLayout,
|
||||
functionLayout,
|
||||
LayoutHelper::String(buffer, strlen(buffer), KDText::FontSize::Small));
|
||||
}
|
||||
m_sum.setLayoutReference(m_sumLayoutReference);
|
||||
m_sum.setLayout(m_sumLayout);
|
||||
if (step == Step::Result) {
|
||||
m_sum.setAlignment(0.5f, 0.5f);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user