You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
edit: looking at the macro API, calling ConfigureOpenElement on a text element is just not valid code so there are No Bugs Here, but it would be nice to have a replacement for CLAY_EXTEND_CONFIG_TEXT.
Hi, it seems like clay doesn't forward Clay_ElementDeclaration::userData through to TEXT render commands:
I would expect this to produce a TEXT render command with the userData pointer set to 1 or 2, but instead clay emits a NONE render command (which I suppose may also be a bug, although it goes away if you don't configure the text element) with userData = 2 and a TEXT command with userData = NULL.
The text was updated successfully, but these errors were encountered:
mikejsavage
changed the title
[Core] userData doesn't get forwarded to text elements
[Core] Can't set userData on text elements
Feb 17, 2025
Ah, I see the issue here. This wasn't obvious to me because I use the macros - but "ConfigureOpenElement" only applies to non text elements opened with Clay_OpenElement. OpenTextElement is a very poor name because it implies the text element remains open for configuration etc, when in reality it's an atomic element - it should be something like CreateTextElement or DeclareTextElement.
I suspect we will need to add a seperate userData pointer to the text element config, so you can pass it as part of Clay__OpenTextElement.
I will look into the render command NONE being emitted, this should never happen so is a bug in this case.
edit: looking at the macro API, calling ConfigureOpenElement on a text element is just not valid code so there are No Bugs Here, but it would be nice to have a replacement for
CLAY_EXTEND_CONFIG_TEXT
.Hi, it seems like clay doesn't forward
Clay_ElementDeclaration::userData
through to TEXT render commands:I would expect this to produce a TEXT render command with the userData pointer set to 1 or 2, but instead clay emits a NONE render command (which I suppose may also be a bug, although it goes away if you don't configure the text element) with userData = 2 and a TEXT command with userData = NULL.
The text was updated successfully, but these errors were encountered: