Switch zero comparison to epsilon

This commit is contained in:
Nic Barker 2025-03-04 10:48:15 +13:00
parent 92ef909341
commit 8f887ee202
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

@ -2124,7 +2124,7 @@ void Clay__SizeContainersAlongAxis(bool xAxis) {
} }
} }
// Scrolling containers preferentially compress before others // Scrolling containers preferentially compress before others
while (sizeToDistribute < -0.1f && resizableContainerBuffer.length > 0) { while (sizeToDistribute < -CLAY__EPSILON && resizableContainerBuffer.length > 0) {
float largest = 0; float largest = 0;
float secondLargest = 0; float secondLargest = 0;
float widthToAdd = sizeToDistribute; float widthToAdd = sizeToDistribute;
@ -2168,7 +2168,7 @@ void Clay__SizeContainersAlongAxis(bool xAxis) {
Clay__int32_tArray_RemoveSwapback(&resizableContainerBuffer, childIndex--); Clay__int32_tArray_RemoveSwapback(&resizableContainerBuffer, childIndex--);
} }
} }
while (sizeToDistribute > 0.1f && resizableContainerBuffer.length > 0) { while (sizeToDistribute > CLAY__EPSILON && resizableContainerBuffer.length > 0) {
float smallest = CLAY__MAXFLOAT; float smallest = CLAY__MAXFLOAT;
float secondSmallest = CLAY__MAXFLOAT; float secondSmallest = CLAY__MAXFLOAT;
float widthToAdd = sizeToDistribute; float widthToAdd = sizeToDistribute;