6 m_expressionLayout(nullptr),
7 m_horizontalAlignment(horizontalAlignment),
8 m_verticalAlignment(verticalAlignment),
9 m_textColor(textColor),
10 m_backgroundColor(backgroundColor)
15 return m_expressionLayout;
24 if (m_backgroundColor != backgroundColor) {
25 m_backgroundColor = backgroundColor;
31 if (textColor != m_textColor) {
32 m_textColor = textColor;
38 m_horizontalAlignment = horizontalAlignment;
39 m_verticalAlignment = verticalAlignment;
44 if (m_expressionLayout ==
nullptr) {
47 return m_expressionLayout->
size();
51 ctx->
fillRect(rect, m_backgroundColor);
52 if (m_expressionLayout !=
nullptr) {
54 KDSize expressionSize = m_expressionLayout->
size();
57 m_expressionLayout->
draw(ctx, origin, m_textColor, m_backgroundColor);
void setBackgroundColor(KDColor backgroundColor)
void draw(KDContext *ctx, KDPoint p, KDColor expressionColor=KDColorBlack, KDColor backgroundColor=KDColorWhite)
constexpr KDCoordinate width() const
void setExpression(Poincare::ExpressionLayout *expressionLayout)
void markRectAsDirty(KDRect rect)
KDSize minimalSizeForOptimalDisplay() const override
void setAlignment(float horizontalAlignment, float verticalAlignment)
ExpressionView(float horizontalAlignment=0.0f, float verticalAlignment=0.5f, KDColor textColor=KDColorBlack, KDColor backgroundColor=KDColorWhite)
Poincare::ExpressionLayout * expressionLayout() const
void setTextColor(KDColor textColor)
void fillRect(KDRect rect, KDColor color)
constexpr KDSize KDSizeZero
void drawRect(KDContext *ctx, KDRect rect) const override
KDCoordinate width() const
KDCoordinate height() const
constexpr KDCoordinate height() const