9 m_baseLayout(baseLayout),
10 m_subscriptLayout(subscriptLayout),
11 m_superscriptLayout(superscriptLayout)
15 if (m_superscriptLayout) {
18 KDSize superscriptSize = m_superscriptLayout ==
nullptr ?
KDSizeZero : m_superscriptLayout->
size();
24 delete m_subscriptLayout;
25 if (m_superscriptLayout) {
26 delete m_superscriptLayout;
36 KDSize subscriptSize = m_subscriptLayout->
size();
37 KDSize superscriptSize = m_superscriptLayout ==
nullptr ?
KDSizeZero : m_superscriptLayout->
size();
46 return m_subscriptLayout;
48 return m_superscriptLayout;
58 KDSize superscriptSize = m_superscriptLayout ==
nullptr ?
KDSizeZero : m_superscriptLayout->
size();
59 if (
child == m_baseLayout) {
60 y = max(0, superscriptSize.
height() - baseSize.
height()/2);
62 if (
child == m_subscriptLayout) {
66 if (
child == m_superscriptLayout) {
void render(KDContext *ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) override
KDSize computeSize() override
KDPoint positionOfChild(ExpressionLayout *child) override
constexpr KDCoordinate width() const
CondensedSumLayout(ExpressionLayout *baseLayout, ExpressionLayout *subscriptLayout, ExpressionLayout *superscriptLayout=nullptr)
constexpr KDSize KDSizeZero
ExpressionLayout * child(uint16_t index) override
void setParent(ExpressionLayout *parent)
constexpr KDCoordinate height() const