Numworks Epsilon  1.4.1
Graphing Calculator Operating System
product_layout.cpp
Go to the documentation of this file.
1 #include "product_layout.h"
2 #include <string.h>
3 #include <assert.h>
4 
5 namespace Poincare {
6 
7 void ProductLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) {
8  KDSize upperBoundSize = m_upperBoundLayout->size();
9  KDSize lowerBoundSize = m_lowerBoundLayout->size();
10  ctx->fillRect(KDRect(p.x() + max(max(0, (upperBoundSize.width()-k_symbolWidth)/2), (lowerBoundSize.width()-k_symbolWidth)/2),
11  p.y() + max(upperBoundSize.height()+k_boundHeightMargin, m_argumentLayout->baseline()-(k_symbolHeight+1)/2),
12  k_lineThickness, k_symbolHeight), expressionColor);
13  ctx->fillRect(KDRect(p.x() + max(max(0, (upperBoundSize.width()-k_symbolWidth)/2), (lowerBoundSize.width()-k_symbolWidth)/2),
14  p.y() + max(upperBoundSize.height()+k_boundHeightMargin, m_argumentLayout->baseline()-(k_symbolHeight+1)/2),
15  k_symbolWidth, k_lineThickness), expressionColor);
16  ctx->fillRect(KDRect(p.x() + max(max(0, (upperBoundSize.width()-k_symbolWidth)/2), (lowerBoundSize.width()-k_symbolWidth)/2)+k_symbolWidth,
17  p.y() + max(upperBoundSize.height()+k_boundHeightMargin, m_argumentLayout->baseline()-(k_symbolHeight+1)/2),
18  k_lineThickness, k_symbolHeight), expressionColor);
19 }
20 
21 }
static constexpr KDCoordinate k_symbolWidth
KDCoordinate y() const
Definition: point.h:11
constexpr KDCoordinate width() const
Definition: size.h:10
static constexpr KDCoordinate k_boundHeightMargin
void render(KDContext *ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) override
Definition: point.h:6
Definition: size.h:6
ExpressionLayout * m_lowerBoundLayout
ExpressionLayout * m_upperBoundLayout
static constexpr KDCoordinate k_symbolHeight
Definition: rect.h:26
void fillRect(KDRect rect, KDColor color)
Definition: context_rect.cpp:8
Definition: color.h:6
KDCoordinate x() const
Definition: point.h:10
constexpr KDCoordinate height() const
Definition: size.h:11
ExpressionLayout * m_argumentLayout