Compare commits

...

3 Commits

Author SHA1 Message Date
Johann Muszynski
a724c9de8a
Merge ad4d00be33 into fabdad43f6 2025-03-10 00:31:48 -05:00
Nic Barker
fabdad43f6 [Documentation] Update internal version number to 0.13 in clay.h
Some checks are pending
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Waiting to run
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Waiting to run
2025-03-10 14:39:18 +13:00
Johann Muszynski
ad4d00be33 Fix integer truncation warnings with explicit casts 2025-03-08 14:53:30 +02:00

8
clay.h
View File

@ -1,4 +1,4 @@
// VERSION: 0.12
// VERSION: 0.13
/*
NOTE: In order to use this library you must define
@ -1924,7 +1924,7 @@ void Clay__ConfigureOpenElement(const Clay_ElementDeclaration declaration) {
.errorText = CLAY_STRING("A floating element was declared with a parentId, but no element with that ID was found."),
.userData = context->errorHandler.userData });
} else {
clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, parentItem->layoutElement - context->layoutElements.internalArray);
clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(parentItem->layoutElement - context->layoutElements.internalArray));
}
} else if (declaration.floating.attachTo == CLAY_ATTACH_TO_ROOT) {
floatingConfig.parentId = Clay__HashString(CLAY_STRING("Clay__RootContainer"), 0, 0).id;
@ -3629,7 +3629,7 @@ uint32_t Clay_MinMemorySize(void) {
Clay__Context_Allocate_Arena(&fakeContext.internalArena);
Clay__InitializePersistentMemory(&fakeContext);
Clay__InitializeEphemeralMemory(&fakeContext);
return fakeContext.internalArena.nextAllocation + 128;
return (uint32_t)fakeContext.internalArena.nextAllocation + 128;
}
CLAY_WASM_EXPORT("Clay_CreateArenaWithCapacityAndMemory")
@ -3682,7 +3682,7 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
context->treeNodeVisited.internalArray[dfsBuffer.length - 1] = true;
Clay_LayoutElement *currentElement = Clay_LayoutElementArray_Get(&context->layoutElements, Clay__int32_tArray_GetValue(&dfsBuffer, (int)dfsBuffer.length - 1));
Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, currentElement - context->layoutElements.internalArray);
int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(currentElement - context->layoutElements.internalArray));
Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
Clay_BoundingBox elementBox = mapItem->boundingBox;
elementBox.x -= root->pointerOffset.x;