diff --git a/README.md b/README.md index 8421279..9637c3c 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ CLAY(CLAY_LAYOUT({ .layoutDirection = CLAY_TOP_TO_BOTTOM })) { } // Only render this element if we're on a mobile screen if (isMobileScreen) { - CLAY() { + CLAY(0) { // etc } } @@ -362,7 +362,7 @@ typedef struct t_CustomElementData { Model myModel = Load3DModel(filePath); CustomElement modelElement = (CustomElement) { .type = CUSTOM_ELEMENT_TYPE_MODEL, .model = myModel } // ... -CLAY() { +CLAY(0) { // This config is type safe and contains the CustomElementData struct CLAY(CLAY_CUSTOM_ELEMENT({ .customData = { .type = CUSTOM_ELEMENT_TYPE_MODEL, .model = myModel } })) {} } @@ -644,6 +644,7 @@ Returns a [Clay_ElementId](#clay_elementid) for the provided id string, used for **Notes** **CLAY** opens a generic empty container, that is configurable and supports nested children. +**CLAY** requires at least 1 parameter, so if you want to create an element without any configuration, use `CLAY(0)`. **Examples** ```C @@ -1925,4 +1926,4 @@ A [Clay_String](#clay_string) that provides a human readable description of the A generic pointer to extra userdata that is transparently passed through from `Clay_Initialize` to Clay's error handler callback. Defaults to NULL. ---- \ No newline at end of file +--- diff --git a/clay.h b/clay.h index c79a490..1995a8f 100644 --- a/clay.h +++ b/clay.h @@ -128,7 +128,7 @@ static uint8_t CLAY__ELEMENT_DEFINITION_LATCH; */ #define CLAY(...) \ for (\ - CLAY__ELEMENT_DEFINITION_LATCH = (Clay__OpenElement(), ##__VA_ARGS__, Clay__ElementPostConfiguration(), 0); \ + CLAY__ELEMENT_DEFINITION_LATCH = (Clay__OpenElement(), __VA_ARGS__, Clay__ElementPostConfiguration(), 0); \ CLAY__ELEMENT_DEFINITION_LATCH < 1; \ ++CLAY__ELEMENT_DEFINITION_LATCH, Clay__CloseElement() \ )