mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[poincare] Clean
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user