mirror of
https://github.com/nicbarker/clay.git
synced 2026-05-31 21:47:15 +00:00
[Core] Fix an issue where exit transition could trigger duplicate ID errors
This commit is contained in:
parent
54b38498b1
commit
34af8b1bcd
1 changed files with 5 additions and 1 deletions
6
clay.h
6
clay.h
|
|
@ -4512,7 +4512,11 @@ Clay_RenderCommandArray Clay_EndLayout(float deltaTime) {
|
|||
int32_t bufferIndex = 0;
|
||||
while (bufferIndex < bfsBuffer.length) {
|
||||
Clay_LayoutElement *layoutElement = Clay_LayoutElementArray_GetCheckCapacity(&context->layoutElements, Clay__int32_tArray_GetValue(&bfsBuffer, bufferIndex));
|
||||
Clay__AddHashMapItem(CLAY__INIT(Clay_ElementId){ layoutElement->id }, layoutElement);
|
||||
Clay_LayoutElementHashMapItem* dfsMapItem = Clay__GetHashMapItem(layoutElement->id);
|
||||
// Children of exiting elements may have been moved elsewhere in the layout, this will throw a duplicate ID error if they still exist.
|
||||
if (dfsMapItem->generation <= context->generation) {
|
||||
Clay__AddHashMapItem(CLAY__INIT(Clay_ElementId){ layoutElement->id }, layoutElement);
|
||||
}
|
||||
bufferIndex++;
|
||||
int32_t firstChildSlot = context->layoutElementChildren.length;
|
||||
for (int j = 0; j < layoutElement->children.length; ++j) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue