Compare commits

..

1 Commits

Author SHA1 Message Date
Abdi Ibrahim
868e019059
Merge 4f50603b8f into bc9ef8b02d 2025-01-10 16:20:11 +08:00
7 changed files with 2 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

4
clay.h
View File

@ -2088,13 +2088,13 @@ void Clay__CompressChildrenAlongAxis(bool xAxis, float totalSizeToDistribute, Cl
Clay__int32_tArray largestContainers = context->openClipElementStack;
largestContainers.length = 0;
while (totalSizeToDistribute > 0.1) {
while (totalSizeToDistribute > 0) {
float largestSize = 0;
float targetSize = 0;
for (int32_t i = 0; i < resizableContainerBuffer.length; ++i) {
Clay_LayoutElement *childElement = Clay_LayoutElementArray_Get(&context->layoutElements, Clay__int32_tArray_Get(&resizableContainerBuffer, i));
float childSize = xAxis ? childElement->dimensions.width : childElement->dimensions.height;
if ((childSize - largestSize) < 0.1 && (childSize - largestSize) > -0.1) {
if (childSize == largestSize) {
Clay__int32_tArray_Add(&largestContainers, Clay__int32_tArray_Get(&resizableContainerBuffer, i));
} else if (childSize > largestSize) {
targetSize = largestSize;