mirror of
https://github.com/nicbarker/clay.git
synced 2026-04-11 05:44:17 +00:00
[Core] Reattach exit transitions with deleted parents
This commit is contained in:
parent
13c6ce71a7
commit
65111f03a3
1 changed files with 7 additions and 1 deletions
8
clay.h
8
clay.h
|
|
@ -4420,7 +4420,6 @@ Clay_RenderCommandArray Clay_EndLayout(float deltaTime) {
|
|||
if (parentHashMapItem->generation <= context->generation) {
|
||||
data->elementThisFrame->config.floating.attachTo = CLAY_ATTACH_TO_ROOT;
|
||||
data->elementThisFrame->config.floating.offset = CLAY__INIT(Clay_Vector2) { hashMapItem->boundingBox.x, hashMapItem->boundingBox.y };
|
||||
data->siblingIndex = 0;
|
||||
}
|
||||
data->elementThisFrame->exiting = true;
|
||||
data->elementThisFrame->config.layout.sizing.width = CLAY_SIZING_FIXED(data->elementThisFrame->dimensions.width);
|
||||
|
|
@ -4482,6 +4481,13 @@ Clay_RenderCommandArray Clay_EndLayout(float deltaTime) {
|
|||
}
|
||||
parentElement->children.length++;
|
||||
parentElement->children.elements = &context->layoutElementChildren.internalArray[newChildrenStartIndex];
|
||||
// Otherwise, just attach to the root as a floating element
|
||||
} else {
|
||||
Clay__LayoutElementTreeRootArray_Add(&context->layoutElementTreeRoots, CLAY__INIT(Clay__LayoutElementTreeRoot) {
|
||||
.layoutElementIndex = data->elementThisFrame - context->layoutElements.internalArray,
|
||||
.parentId = Clay__HashString(CLAY_STRING("Clay__RootContainer"), 0).id,
|
||||
.zIndex = 1,
|
||||
});
|
||||
}
|
||||
// Parent exited, just delete child without exit transition
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue