From c2683ba8a167c141b4400c87df1f6639265e14f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 7 Jun 2017 16:49:38 +0200 Subject: [PATCH] [apps/sequence] Add a margin in the term sum banner Change-Id: I1053f0f27b64fa0802a92c1cc2c2184c44508259 --- apps/sequence/graph/term_sum_controller.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/sequence/graph/term_sum_controller.cpp b/apps/sequence/graph/term_sum_controller.cpp index da1c8a042..832fd92ad 100644 --- a/apps/sequence/graph/term_sum_controller.cpp +++ b/apps/sequence/graph/term_sum_controller.cpp @@ -222,10 +222,10 @@ void TermSumController::ContentView::LegendView::setSumSubscript(float start) { delete m_sumLayout; m_sumLayout = nullptr; } - const char sigma[2] = {Ion::Charset::CapitalSigma, 0}; + const char sigma[3] = {' ',Ion::Charset::CapitalSigma, 0}; char buffer[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)]; Complex::convertFloatToText(start, buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Expression::FloatDisplayMode::Decimal); - m_sumLayout = new CondensedSumLayout(new StringLayout(sigma, 1), new StringLayout(buffer, strlen(buffer), KDText::FontSize::Small), nullptr); + m_sumLayout = new CondensedSumLayout(new StringLayout(sigma, 2), new StringLayout(buffer, strlen(buffer), KDText::FontSize::Small), nullptr); m_sum.setExpression(m_sumLayout); m_sum.setAlignment(0.0f, 0.5f); layoutSubviews(); @@ -236,13 +236,14 @@ void TermSumController::ContentView::LegendView::setSumSuperscript(float start, delete m_sumLayout; m_sumLayout = nullptr; } - const char sigma[2] = {Ion::Charset::CapitalSigma, 0}; + const char sigma[3] = {' ', Ion::Charset::CapitalSigma, 0}; char bufferStart[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)]; Complex::convertFloatToText(start, bufferStart, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Expression::FloatDisplayMode::Decimal); char bufferEnd[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)]; Complex::convertFloatToText(end, bufferEnd, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Expression::FloatDisplayMode::Decimal); - m_sumLayout = new CondensedSumLayout(new StringLayout(sigma, 1), new StringLayout(bufferStart, strlen(bufferStart), KDText::FontSize::Small), new StringLayout(bufferEnd, strlen(bufferEnd), KDText::FontSize::Small)); + m_sumLayout = new CondensedSumLayout(new StringLayout(sigma, 2), new StringLayout(bufferStart, strlen(bufferStart), KDText::FontSize::Small), new StringLayout(bufferEnd, strlen(bufferEnd), KDText::FontSize::Small)); m_sum.setExpression(m_sumLayout); + m_sum.setAlignment(0.0f, 0.5f); layoutSubviews(); }