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
}
Poincare::SequenceLayout::k_symbolWidth
static constexpr KDCoordinate k_symbolWidth
Definition:
sequence_layout.h:18
KDPoint::y
KDCoordinate y() const
Definition:
point.h:11
Poincare::ExpressionLayout::size
KDSize size()
Definition:
expression_layout.cpp:48
KDSize::width
constexpr KDCoordinate width() const
Definition:
size.h:10
Poincare::SequenceLayout::k_boundHeightMargin
static constexpr KDCoordinate k_boundHeightMargin
Definition:
sequence_layout.h:20
Poincare::ProductLayout::render
void render(KDContext *ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) override
Definition:
product_layout.cpp:7
Poincare
Definition:
absolute_value.h:8
KDPoint
Definition:
point.h:6
KDSize
Definition:
size.h:6
assert.h
Poincare::SequenceLayout::m_lowerBoundLayout
ExpressionLayout * m_lowerBoundLayout
Definition:
sequence_layout.h:21
Poincare::SequenceLayout::m_upperBoundLayout
ExpressionLayout * m_upperBoundLayout
Definition:
sequence_layout.h:22
Poincare::SequenceLayout::k_symbolHeight
static constexpr KDCoordinate k_symbolHeight
Definition:
sequence_layout.h:17
KDContext
Definition:
context.h:8
Poincare::ExpressionLayout::baseline
KDCoordinate baseline()
Definition:
expression_layout.cpp:15
KDRect
Definition:
rect.h:26
KDContext::fillRect
void fillRect(KDRect rect, KDColor color)
Definition:
context_rect.cpp:8
KDColor
Definition:
color.h:6
KDPoint::x
KDCoordinate x() const
Definition:
point.h:10
product_layout.h
KDSize::height
constexpr KDCoordinate height() const
Definition:
size.h:11
Poincare::SequenceLayout::m_argumentLayout
ExpressionLayout * m_argumentLayout
Definition:
sequence_layout.h:23
epsilon
poincare
src
layout
product_layout.cpp
Generated by
1.8.14