From 9b83bee8b6dfb35fdd989c8d9341e3e8cd88ef5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 7 Dec 2017 09:51:37 +0100 Subject: [PATCH] [poincare] Clean --- poincare/src/layout/bracket_layout.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/poincare/src/layout/bracket_layout.cpp b/poincare/src/layout/bracket_layout.cpp index e679fc791..dddd78aa9 100644 --- a/poincare/src/layout/bracket_layout.cpp +++ b/poincare/src/layout/bracket_layout.cpp @@ -19,24 +19,22 @@ BracketLayout::~BracketLayout() { } void BracketLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) { - const KDCoordinate k_widthMargin = widthMargin(); KDSize operandSize = m_operandLayout->size(); ctx->fillRect(KDRect(p.x(), p.y(), k_lineThickness, m_operandLayout->size().height()), expressionColor); - ctx->fillRect(KDRect(p.x()+operandSize.width()+2*k_widthMargin+k_lineThickness, p.y(), k_lineThickness, m_operandLayout->size().height()), expressionColor); + ctx->fillRect(KDRect(p.x()+operandSize.width()+2*widthMargin()+k_lineThickness, p.y(), k_lineThickness, m_operandLayout->size().height()), expressionColor); if (renderTopBar()) { ctx->fillRect(KDRect(p.x(), p.y(), k_bracketWidth, k_lineThickness), expressionColor); - ctx->fillRect(KDRect(p.x()+2*k_lineThickness+operandSize.width()+2*k_widthMargin-k_bracketWidth, p.y(), k_bracketWidth, k_lineThickness), expressionColor); + ctx->fillRect(KDRect(p.x()+2*k_lineThickness+operandSize.width()+2*widthMargin()-k_bracketWidth, p.y(), k_bracketWidth, k_lineThickness), expressionColor); } if (renderBottomBar()) { ctx->fillRect(KDRect(p.x(), p.y()+operandSize.height()-k_lineThickness, k_bracketWidth, k_lineThickness), expressionColor); - ctx->fillRect(KDRect(p.x()+2*k_lineThickness+operandSize.width()+2*k_widthMargin-k_bracketWidth, p.y()+operandSize.height()-k_lineThickness, k_bracketWidth, k_lineThickness), expressionColor); + ctx->fillRect(KDRect(p.x()+2*k_lineThickness+operandSize.width()+2*widthMargin()-k_bracketWidth, p.y()+operandSize.height()-k_lineThickness, k_bracketWidth, k_lineThickness), expressionColor); } } KDSize BracketLayout::computeSize() { - const KDCoordinate k_widthMargin = widthMargin(); KDSize operandSize = m_operandLayout->size(); - return KDSize(operandSize.width() + 2*k_widthMargin + 2*k_lineThickness, operandSize.height()); + return KDSize(operandSize.width() + 2*widthMargin() + 2*k_lineThickness, operandSize.height()); } ExpressionLayout * BracketLayout::child(uint16_t index) { @@ -47,8 +45,7 @@ ExpressionLayout * BracketLayout::child(uint16_t index) { } KDPoint BracketLayout::positionOfChild(ExpressionLayout * child) { - const KDCoordinate k_widthMargin = widthMargin(); - return KDPoint(k_widthMargin+k_lineThickness, 0); + return KDPoint(widthMargin()+k_lineThickness, 0); } }