From 86cadd66514533283bddf2ffcdb1f1b86e6f7bd6 Mon Sep 17 00:00:00 2001 From: Michael Savage Date: Mon, 17 Feb 2025 21:06:17 +0000 Subject: [PATCH] [Core] Add a userData pointer to Clay_TextElementConfig --- clay.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clay.h b/clay.h index 810eb50..7d087dd 100644 --- a/clay.h +++ b/clay.h @@ -357,6 +357,8 @@ typedef CLAY_PACKED_ENUM { // Controls various functionality related to text elements. typedef struct { + // A pointer that will be transparently passed through to the resulting render command. + void *userData; // The RGBA color of the font to render, conventionally specified as 0-255. Clay_Color textColor; // An integer transparently passed to Clay_MeasureText to identify the font to use. @@ -2692,7 +2694,7 @@ void Clay__CalculateFinalLayout(void) { .letterSpacing = textElementConfig->letterSpacing, .lineHeight = textElementConfig->lineHeight, }}, - .userData = sharedConfig->userData, + .userData = textElementConfig->userData, .id = Clay__HashNumber(lineIndex, currentElement->id).id, .zIndex = root->zIndex, .commandType = CLAY_RENDER_COMMAND_TYPE_TEXT,