From 081e762f83f8c31997aa4f779dbf121c0fda2b10 Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Mon, 20 Apr 2026 10:54:34 +1000 Subject: [PATCH] Fix a small transition activation bug --- clay.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clay.h b/clay.h index 92b6eb2..8d5f472 100644 --- a/clay.h +++ b/clay.h @@ -3607,8 +3607,8 @@ void Clay__RenderDebugView(void) { } } CLAY_AUTO_ID({ .layout = { .sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIXED(1)} }, .backgroundColor = CLAY__DEBUGVIEW_COLOR_3 }) {} - if (context->debugSelectedElementId != 0) { - Clay_LayoutElementHashMapItem *selectedItem = Clay__GetHashMapItem(context->debugSelectedElementId); + Clay_LayoutElementHashMapItem *selectedItem = Clay__GetHashMapItem(context->debugSelectedElementId); + if (selectedItem->layoutElement) { CLAY_AUTO_ID({ .layout = { .sizing = {CLAY_SIZING_GROW(0), CLAY_SIZING_FIXED(300)}, .layoutDirection = CLAY_TOP_TO_BOTTOM }, .backgroundColor = CLAY__DEBUGVIEW_COLOR_2 , @@ -4623,6 +4623,7 @@ Clay_RenderCommandArray Clay_EndLayout(float deltaTime) { } } if (properties & CLAY_TRANSITION_PROPERTY_Y) { + // See extended comments above in PROPERTY_X for explanation if (!Clay__FloatEqual(oldTargetState.boundingBox.y, targetState.boundingBox.y) && (!(Clay__FloatEqual(oldRelativePosition.y, newRelativePosition.y)) || transitionData->reparented) && !context->rootResizedLastFrame) { newActiveProperties |= CLAY_TRANSITION_PROPERTY_Y; } @@ -4682,7 +4683,7 @@ Clay_RenderCommandArray Clay_EndLayout(float deltaTime) { transitionData->activeProperties }); - Clay_ApplyTransitionedPropertiesToElement(currentElement, currentElement->config.transition.properties, transitionData->currentState, &mapItem->boundingBox, transitionData->reparented); + Clay_ApplyTransitionedPropertiesToElement(currentElement, transitionData->activeProperties, transitionData->currentState, &mapItem->boundingBox, transitionData->reparented); transitionData->elapsedTime += deltaTime; if (transitionComplete) {