mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 06:40:37 +01:00
[poincare] LayoutNode::changeGreySquaresOfAllMatrixAncestors uses Refs
This commit is contained in:
@@ -44,6 +44,7 @@ public:
|
||||
bool mustHaveLeftSibling() const { return const_cast<LayoutReference *>(this)->node()->mustHaveLeftSibling(); }
|
||||
bool isEmpty() const { return const_cast<LayoutReference *>(this)->node()->isEmpty(); }
|
||||
bool isHorizontal() const { return const_cast<LayoutReference *>(this)->node()->isHorizontal(); }
|
||||
bool isMatrix() const { return const_cast<LayoutReference *>(this)->node()->isMatrix(); }
|
||||
bool isVerticalOffset() const { return const_cast<LayoutReference *>(this)->node()->isVerticalOffset(); }
|
||||
bool isLeftParenthesis() const { return const_cast<LayoutReference *>(this)->node()->isLeftParenthesis(); }
|
||||
bool isCollapsable(int * numberOfOpenParenthesis, bool goingLeft) const { return const_cast<LayoutReference *>(this)->node()->isCollapsable(numberOfOpenParenthesis, goingLeft); }
|
||||
|
||||
@@ -255,17 +255,17 @@ void LayoutNode::scoreCursorInDescendantsVertically (
|
||||
|
||||
bool LayoutNode::changeGreySquaresOfAllMatrixAncestors(bool add) {
|
||||
bool changedSquares = false;
|
||||
LayoutNode * currentAncestor = parent();
|
||||
while (currentAncestor != nullptr) {
|
||||
if (currentAncestor->isMatrix()) {
|
||||
LayoutRef currentAncestor = LayoutRef(parent());
|
||||
while (currentAncestor.isDefined()) {
|
||||
if (currentAncestor.isMatrix()) {
|
||||
if (add) {
|
||||
static_cast<MatrixLayoutNode *>(currentAncestor)->addGreySquares();
|
||||
static_cast<MatrixLayoutNode *>(currentAncestor.node())->addGreySquares();
|
||||
} else {
|
||||
static_cast<MatrixLayoutNode *>(currentAncestor)->removeGreySquares();
|
||||
static_cast<MatrixLayoutNode *>(currentAncestor.node())->removeGreySquares();
|
||||
}
|
||||
changedSquares = true;
|
||||
}
|
||||
currentAncestor = currentAncestor->parent();
|
||||
currentAncestor = currentAncestor.parent();
|
||||
}
|
||||
return changedSquares;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user