mirror of
https://github.com/nicbarker/clay.git
synced 2026-05-31 13:37:13 +00:00
Fix a small transition activation bug
This commit is contained in:
parent
f2c01b4bac
commit
081e762f83
1 changed files with 4 additions and 3 deletions
7
clay.h
7
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue