Skip to content

Commit

Permalink
Fix a bug with the new padding
Browse files Browse the repository at this point in the history
  • Loading branch information
nicbarker committed Jan 14, 2025
1 parent 1b2ef6d commit 4fd677e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions clay.h
Original file line number Diff line number Diff line change
Expand Up @@ -2596,7 +2596,7 @@ void Clay__CalculateFinalLayout() {
});
}
}
Clay__LayoutElementTreeNodeArray_Add(&dfsBuffer, CLAY__INIT(Clay__LayoutElementTreeNode) { .layoutElement = rootElement, .position = rootPosition, .nextChildOffset = { .x = (float)(rootElement->layoutConfig->padding.left + rootElement->layoutConfig->padding.right), .y = (float)(rootElement->layoutConfig->padding.top + rootElement->layoutConfig->padding.bottom) } });
Clay__LayoutElementTreeNodeArray_Add(&dfsBuffer, CLAY__INIT(Clay__LayoutElementTreeNode) { .layoutElement = rootElement, .position = rootPosition, .nextChildOffset = { .x = (float)rootElement->layoutConfig->padding.left, .y = (float)rootElement->layoutConfig->padding.top } });

context->treeNodeVisited.internalArray[0] = false;
while (dfsBuffer.length > 0) {
Expand Down Expand Up @@ -4016,10 +4016,7 @@ CLAY_WASM_EXPORT("Clay_GetElementData")
Clay_ElementData Clay_GetElementData(Clay_ElementId id){
Clay_LayoutElementHashMapItem * item = Clay__GetHashMapItem(id.id);
if(item == &CLAY__LAYOUT_ELEMENT_HASH_MAP_ITEM_DEFAULT) {
return CLAY__INIT(Clay_ElementData){
.found = false,
.elementLocation = CLAY__STRUC
};
return CLAY__INIT(Clay_ElementData) CLAY__DEFAULT_STRUCT;
}

return CLAY__INIT(Clay_ElementData) {
Expand Down

0 comments on commit 4fd677e

Please sign in to comment.