Skip to content

Commit

Permalink
[Core] Fix layout bug in SIZING_PERCENT
Browse files Browse the repository at this point in the history
  • Loading branch information
nicbarker committed Jan 21, 2025
1 parent 16f894b commit 81589ad
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions clay.h
Original file line number Diff line number Diff line change
Expand Up @@ -2257,12 +2257,6 @@ void Clay__SizeContainersAlongAxis(bool xAxis) {
*childSize = (parentSize - totalPaddingAndChildGaps) * childSizing.size.percent;
if (sizingAlongAxis) {
innerContentSize += *childSize;
if (childOffset > 0) {
innerContentSize += parentChildGap; // For children after index 0, the childAxisOffset is the gap from the previous child
totalPaddingAndChildGaps += parentChildGap;
}
} else {
innerContentSize = CLAY__MAX(*childSize, innerContentSize);
}
}
}
Expand Down Expand Up @@ -2483,9 +2477,6 @@ void Clay__CalculateFinalLayout() {

// DFS node has been visited, this is on the way back up to the root
Clay_LayoutConfig *layoutConfig = currentElement->layoutConfig;
if (layoutConfig->sizing.height.type == CLAY__SIZING_TYPE_PERCENT) {
continue;
}
if (layoutConfig->layoutDirection == CLAY_LEFT_TO_RIGHT) {
// Resize any parent containers that have grown in height along their non layout axis
for (int32_t j = 0; j < currentElement->childrenOrTextContent.children.length; ++j) {
Expand Down

0 comments on commit 81589ad

Please sign in to comment.