mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[poincare] Fix DynamicLayoutHierarchy::mergeChildrenAtIndex
Change-Id: I579d3daf9791e06474a66071b2b2be0908a8cf02
This commit is contained in:
@@ -37,11 +37,15 @@ DynamicLayoutHierarchy::~DynamicLayoutHierarchy() {
|
||||
}
|
||||
|
||||
void DynamicLayoutHierarchy::mergeChildrenAtIndex(DynamicLayoutHierarchy * eL, int index, bool removeEmptyChildren) {
|
||||
int indexForInsertion = index;
|
||||
int indexOfEL = indexOfChild(eL);
|
||||
if (indexOfEL >= 0) {
|
||||
removeChildAtIndex(indexOfEL, false);
|
||||
if (indexOfEL < index) {
|
||||
indexForInsertion--;
|
||||
}
|
||||
}
|
||||
addChildrenAtIndex(eL->children(), eL->numberOfChildren(), index, removeEmptyChildren);
|
||||
addChildrenAtIndex(eL->children(), eL->numberOfChildren(), indexForInsertion, removeEmptyChildren);
|
||||
eL->detachChildren();
|
||||
delete eL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user