Skip to content

Commit

Permalink
Support moving views between superviews within on hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
zintus authored and lucdion committed Feb 22, 2018
1 parent 53eaa7c commit c303faa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/YogaKit/YGLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,12 @@ static void YGAttachNodesFromViewHierachy(UIView *const view)
if (!YGNodeHasExactSameChildren(node, subviewsToInclude)) {
YGRemoveAllChildren(node);
for (int i=0; i<subviewsToInclude.count; i++) {
YGNodeInsertChild(node, subviewsToInclude[i].yoga.node, i);
YGNodeRef child = subviewsToInclude[i].yoga.node;
YGNodeRef parent = YGNodeGetParent(child);
if (parent != NULL) {
YGNodeRemoveChild(parent, child);
}
YGNodeInsertChild(node, child, i);
}
}

Expand Down

0 comments on commit c303faa

Please sign in to comment.