This commit is contained in:
Michael Savage 2025-02-17 21:35:42 +00:00 committed by GitHub
commit 211bc0bc6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

4
clay.h
View File

@ -360,6 +360,8 @@ typedef struct {
// CLAY_TEXT_ALIGN_CENTER - Horizontally aligns wrapped lines of text to the center of their bounding box. // CLAY_TEXT_ALIGN_CENTER - Horizontally aligns wrapped lines of text to the center of their bounding box.
// CLAY_TEXT_ALIGN_RIGHT - Horizontally aligns wrapped lines of text to the right hand side of their bounding box. // CLAY_TEXT_ALIGN_RIGHT - Horizontally aligns wrapped lines of text to the right hand side of their bounding box.
Clay_TextAlignment textAlignment; Clay_TextAlignment textAlignment;
// A pointer that will be transparently passed through to the resulting render command.
void *userData;
// When set to true, clay will hash the entire text contents of this string as an identifier for its internal // When set to true, clay will hash the entire text contents of this string as an identifier for its internal
// text measurement cache, rather than just the pointer and length. This will incur significant performance cost for // text measurement cache, rather than just the pointer and length. This will incur significant performance cost for
// long bodies of text. // long bodies of text.
@ -2660,7 +2662,7 @@ void Clay__CalculateFinalLayout(void) {
.letterSpacing = textElementConfig->letterSpacing, .letterSpacing = textElementConfig->letterSpacing,
.lineHeight = textElementConfig->lineHeight, .lineHeight = textElementConfig->lineHeight,
}}, }},
.userData = sharedConfig->userData, .userData = textElementConfig->userData,
.id = Clay__HashNumber(lineIndex, currentElement->id).id, .id = Clay__HashNumber(lineIndex, currentElement->id).id,
.zIndex = root->zIndex, .zIndex = root->zIndex,
.commandType = CLAY_RENDER_COMMAND_TYPE_TEXT, .commandType = CLAY_RENDER_COMMAND_TYPE_TEXT,