mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 04:00:02 +02:00
[poincare] LayoutCursor::addEmptyTenPowerLayout
This commit is contained in:
@@ -75,6 +75,13 @@ public:
|
||||
addChildTreeAtIndex(l2, 1);
|
||||
}
|
||||
|
||||
HorizontalLayoutRef(LayoutRef l1, LayoutRef l2, LayoutRef l3, LayoutRef l4) : LayoutReference<HorizontalLayoutNode>() {
|
||||
addChildTreeAtIndex(l1, 0);
|
||||
addChildTreeAtIndex(l2, 1);
|
||||
addChildTreeAtIndex(l3, 2);
|
||||
addChildTreeAtIndex(l4, 3);
|
||||
}
|
||||
|
||||
void addOrMergeChildAtIndex(LayoutRef l, int index, bool removeEmptyChildren, LayoutCursor * cursor = nullptr);
|
||||
void mergeChildrenAtIndex(HorizontalLayoutRef h, int index, bool removeEmptyChildren, LayoutCursor * cursor = nullptr);
|
||||
private:
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
void addEmptyPowerLayout();
|
||||
void addEmptySquareRootLayout() {} //TODO
|
||||
void addEmptySquarePowerLayout();
|
||||
void addEmptyTenPowerLayout() {} //TODO
|
||||
void addEmptyTenPowerLayout();
|
||||
void addFractionLayoutAndCollapseSiblings() {} //TODO
|
||||
void addXNTCharLayout();
|
||||
void insertText(const char * text);
|
||||
|
||||
@@ -90,6 +90,22 @@ void LayoutCursor::addEmptySquarePowerLayout() {
|
||||
privateAddEmptyPowerLayout(offsetLayout);
|
||||
}
|
||||
|
||||
void LayoutCursor::addEmptyTenPowerLayout() {
|
||||
EmptyLayoutRef emptyLayout;
|
||||
HorizontalLayoutRef sibling = HorizontalLayoutRef(
|
||||
CharLayoutRef(Ion::Charset::MiddleDot),
|
||||
CharLayoutRef('1'),
|
||||
CharLayoutRef('0'),
|
||||
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::addXNTCharLayout() {
|
||||
m_layoutRef.addSibling(this, CharLayoutRef(m_layoutRef.XNTChar()), true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user