mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-19 04:38:01 +00:00
[Core] Remove ##__VA_ARGS__ in CLAY macro
This commit is contained in:
parent
b4452d080c
commit
85634f63b0
@ -187,7 +187,7 @@ CLAY(CLAY_LAYOUT({ .layoutDirection = CLAY_TOP_TO_BOTTOM })) {
|
|||||||
}
|
}
|
||||||
// Only render this element if we're on a mobile screen
|
// Only render this element if we're on a mobile screen
|
||||||
if (isMobileScreen) {
|
if (isMobileScreen) {
|
||||||
CLAY() {
|
CLAY(0) {
|
||||||
// etc
|
// etc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ typedef struct t_CustomElementData {
|
|||||||
Model myModel = Load3DModel(filePath);
|
Model myModel = Load3DModel(filePath);
|
||||||
CustomElement modelElement = (CustomElement) { .type = CUSTOM_ELEMENT_TYPE_MODEL, .model = myModel }
|
CustomElement modelElement = (CustomElement) { .type = CUSTOM_ELEMENT_TYPE_MODEL, .model = myModel }
|
||||||
// ...
|
// ...
|
||||||
CLAY() {
|
CLAY(0) {
|
||||||
// This config is type safe and contains the CustomElementData struct
|
// This config is type safe and contains the CustomElementData struct
|
||||||
CLAY(CLAY_CUSTOM_ELEMENT({ .customData = { .type = CUSTOM_ELEMENT_TYPE_MODEL, .model = myModel } })) {}
|
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**
|
**Notes**
|
||||||
|
|
||||||
**CLAY** opens a generic empty container, that is configurable and supports nested children.
|
**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**
|
**Examples**
|
||||||
```C
|
```C
|
||||||
|
2
clay.h
2
clay.h
@ -128,7 +128,7 @@ static uint8_t CLAY__ELEMENT_DEFINITION_LATCH;
|
|||||||
*/
|
*/
|
||||||
#define CLAY(...) \
|
#define CLAY(...) \
|
||||||
for (\
|
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 < 1; \
|
||||||
++CLAY__ELEMENT_DEFINITION_LATCH, Clay__CloseElement() \
|
++CLAY__ELEMENT_DEFINITION_LATCH, Clay__CloseElement() \
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user