This commit is contained in:
Lily Nikitin 2025-09-17 16:56:49 -04:00 committed by GitHub
commit 85f779f61d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

7
clay.h
View file

@ -520,6 +520,9 @@ typedef struct Clay_CustomElementConfig {
// A transparent pointer through which you can pass custom data to the renderer. // A transparent pointer through which you can pass custom data to the renderer.
// Generates CUSTOM render commands. // Generates CUSTOM render commands.
void* customData; void* customData;
// An integer Dd value to help identify the custom data element during the rendering stage.
uint32_t customCommandId;
} Clay_CustomElementConfig; } Clay_CustomElementConfig;
CLAY__WRAPPER_STRUCT(Clay_CustomElementConfig); CLAY__WRAPPER_STRUCT(Clay_CustomElementConfig);
@ -605,8 +608,11 @@ typedef struct Clay_CustomRenderData {
// Controls the "radius", or corner rounding of this custom element. // Controls the "radius", or corner rounding of this custom element.
// The rounding is determined by drawing a circle inset into the element corner by (radius, radius) pixels. // The rounding is determined by drawing a circle inset into the element corner by (radius, radius) pixels.
Clay_CornerRadius cornerRadius; Clay_CornerRadius cornerRadius;
// A pointer transparently passed through from the original element definition. // A pointer transparently passed through from the original element definition.
void* customData; void* customData;
// An id value transparently passed through from the original element definition.
uint32_t customCommandId;
} Clay_CustomRenderData; } Clay_CustomRenderData;
// Render command data when commandType == CLAY_RENDER_COMMAND_TYPE_SCISSOR_START || commandType == CLAY_RENDER_COMMAND_TYPE_SCISSOR_END // Render command data when commandType == CLAY_RENDER_COMMAND_TYPE_SCISSOR_START || commandType == CLAY_RENDER_COMMAND_TYPE_SCISSOR_END
@ -2918,6 +2924,7 @@ void Clay__CalculateFinalLayout(void) {
.backgroundColor = sharedConfig->backgroundColor, .backgroundColor = sharedConfig->backgroundColor,
.cornerRadius = sharedConfig->cornerRadius, .cornerRadius = sharedConfig->cornerRadius,
.customData = elementConfig->config.customElementConfig->customData, .customData = elementConfig->config.customElementConfig->customData,
.customCommandId = elementConfig->config.customElementConfig->customCommandId
} }
}; };
emitRectangle = false; emitRectangle = false;