mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[poincare] LayoutCursor::addEmptyExponentialLayout
This commit is contained in:
@@ -107,7 +107,7 @@ public:
|
||||
}
|
||||
|
||||
/* Layout modification */
|
||||
void addEmptyExponentialLayout() {} //TODO
|
||||
void addEmptyExponentialLayout();
|
||||
void addEmptyMatrixLayout() {} //TODO
|
||||
void addEmptyPowerLayout();
|
||||
void addEmptySquareRootLayout() {} //TODO
|
||||
|
||||
@@ -91,6 +91,10 @@ public:
|
||||
assert(isDefined());
|
||||
return node()->hasSibling(t.node());
|
||||
}
|
||||
bool hasAncestor(TreeReference<TreeNode> t, bool includeSelf) const {
|
||||
assert(isDefined());
|
||||
return node()->hasAncestor(t.node(), includeSelf);
|
||||
}
|
||||
int numberOfChildren() const {
|
||||
assert(isDefined());
|
||||
return node()->numberOfChildren();
|
||||
|
||||
@@ -65,6 +65,18 @@ void LayoutCursor::moveUnder(bool * shouldRecomputeLayout) {
|
||||
|
||||
/* Layout modification */
|
||||
|
||||
void LayoutCursor::addEmptyExponentialLayout() {
|
||||
EmptyLayoutRef emptyLayout;
|
||||
HorizontalLayoutRef sibling = HorizontalLayoutRef(
|
||||
CharLayoutRef(Ion::Charset::Exponential),
|
||||
VerticalOffsetLayoutRef(emptyLayout, VerticalOffsetLayoutNode::Type::Superscript));
|
||||
LayoutRef rootRef = m_layoutRef.root();
|
||||
m_layoutRef.addSibling(this, sibling, false);
|
||||
if (emptyLayout.hasAncestor(rootRef, false) && !emptyLayout.isAllocationFailure()) {
|
||||
m_layoutRef = emptyLayout;
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyPowerLayout() {
|
||||
VerticalOffsetLayoutRef offsetLayout = VerticalOffsetLayoutRef(EmptyLayoutRef(), VerticalOffsetLayoutNode::Type::Superscript);
|
||||
privateAddEmptyPowerLayout(offsetLayout);
|
||||
|
||||
Reference in New Issue
Block a user