Update odin bindings for CLAY_ID_LOCAL

This commit is contained in:
Nic Barker 2024-09-28 15:49:43 +12:00
parent 5e7c4c41eb
commit 21d9f06a47
7 changed files with 8 additions and 3 deletions

View File

@ -84,7 +84,7 @@ Clay_LayoutConfig sidebarItemLayout = (Clay_LayoutConfig) {
// Re-useable components are just normal functions
void SidebarItemComponent(int index) {
CLAY_RECTANGLE(CLAY_IDI("SidebarBlob", index), sidebarItemLayout, CLAY_RECTANGLE_CONFIG(.color = COLOR_ORANGE)) {};
CLAY_RECTANGLE(CLAY_IDI("SidebarBlob", index), sidebarItemLayout, CLAY_RECTANGLE_CONFIG(.color = COLOR_ORANGE)) {}
}
// An example function to begin the "root" of your layout tree

View File

@ -282,7 +282,8 @@ foreign Clay {
_StoreCustomElementConfig :: proc(config: CustomElementConfig) -> ^CustomElementConfig ---
_StoreScrollElementConfig :: proc(config: ScrollElementConfig) -> ^ScrollElementConfig ---
_StoreBorderElementConfig :: proc(config: BorderElementConfig) -> ^BorderElementConfig ---
_HashString :: proc(toHash: String, index: u32) -> ElementId ---
_HashString :: proc(toHash: String, index: u32, seed: u32) -> ElementId ---
_GetOpenLayoutElementId :: proc() -> u32 ---
}
@(require_results, deferred_none = _CloseElementWithChildren)
@ -409,5 +410,9 @@ MakeString :: proc(label: string) -> String {
}
ID :: proc(label: string, index: u32 = 0) -> ElementId {
return _HashString(MakeString(label), index)
return _HashString(MakeString(label), index, 0)
}
IDLocal :: proc(label: string, index: u32 = 0) -> ElementId {
return _HashString(MakeString(label), index, _GetOpenLayoutElementId())
}

Binary file not shown.

Binary file not shown.

Binary file not shown.