From ff3b69d94fbe9984f3963323512fc67bbffcdc25 Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Thu, 12 Dec 2024 10:31:41 +1300 Subject: [PATCH] Fix a bug with borders that could cause duplicate IDs --- clay.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clay.h b/clay.h index 12ecda7..6f1997d 100644 --- a/clay.h +++ b/clay.h @@ -2683,10 +2683,10 @@ void Clay__CalculateFinalLayout() { Clay_BoundingBox currentElementBoundingBox = currentElementData->boundingBox; Clay_BorderElementConfig *borderConfig = Clay__FindElementConfigWithType(currentElement, CLAY__ELEMENT_CONFIG_TYPE_BORDER_CONTAINER).borderElementConfig; Clay_RenderCommand renderCommand = CLAY__INIT(Clay_RenderCommand) { - .commandType = CLAY_RENDER_COMMAND_TYPE_BORDER, .boundingBox = currentElementBoundingBox, .config = { .borderElementConfig = borderConfig }, - .id = currentElement->id, + .id = Clay__RehashWithNumber(currentElement->id, 4), + .commandType = CLAY_RENDER_COMMAND_TYPE_BORDER, }; Clay__AddRenderCommand(renderCommand); if (borderConfig->betweenChildren.width > 0 && borderConfig->betweenChildren.color.a > 0) {