This PR streamlines the way elements are declared / opened in clay, and allows you to attach multiple configs / element types to each element.
the PR also introduces optional IDs and layout config declaration, which together with multiple configs can significantly reduce boilerplate in layout declaration.
It also includes a significant rewrite of the text wrapping logic and cache, which has improved performance by 2-3x.
Migration Guide
This PR introduces significant breaking changes to public APIs. The general process of refactoring should be as follows:
Rather than needing to be declared as seperate elements, elements can now be "configured" with any combination of RECTANGLE, BORDER, SCROLL, etc. These configurations are declared inside the generic CLAY() element declaration. e.g. CLAY(CLAY_RECTANGLE(...), CLAY_BORDER(...)) { ...children }
CLAY_ID is now optional and can be left unspecified.
Rename all element macros, e.g. instances of CLAY_RECTANGLE(, CLAY_SCROLL(, CLAY_BORDER( to just CLAY(
Rename all element config macros, e.g. instances of CLAY_RECTANGLE_CONFIG(, CLAY_SCROLL_CONFIG(, CLAY_BORDER_CONFIG( to CLAY_RECTANGLE(, CLAY_SCROLL( etc.
All macros that take designated initializer syntax (i.e. struct members) now need to have their contents wrapped in { } e.g. CLAY_SCROLL(.vertical = true) becomes CLAY_SCROLL({ .vertical = true })
Any empty layout configs or references to &CLAY_LAYOUT_DEFAULT can be removed.
For changes to Odin bindings, observe the changes to bindings/odin/examples/clay-official-website/clay-official-website.odin in this commit
Full details of changelist will be enumerated in the 0.12 release.
This PR streamlines the way elements are declared / opened in clay, and allows you to attach multiple configs / element types to each element.
the PR also introduces optional IDs and layout config declaration, which together with multiple configs can significantly reduce boilerplate in layout declaration.
It also includes a significant rewrite of the text wrapping logic and cache, which has improved performance by 2-3x.
Migration Guide
This PR introduces significant breaking changes to public APIs. The general process of refactoring should be as follows:
RECTANGLE
,BORDER
,SCROLL
, etc. These configurations are declared inside the genericCLAY()
element declaration. e.g.CLAY(CLAY_RECTANGLE(...), CLAY_BORDER(...)) { ...children }
CLAY_ID
is now optional and can be left unspecified.CLAY_RECTANGLE(
,CLAY_SCROLL(
,CLAY_BORDER(
to justCLAY(
CLAY_RECTANGLE_CONFIG(
,CLAY_SCROLL_CONFIG(
,CLAY_BORDER_CONFIG(
toCLAY_RECTANGLE(
,CLAY_SCROLL(
etc.{ }
e.g.CLAY_SCROLL(.vertical = true)
becomesCLAY_SCROLL({ .vertical = true })
&CLAY_LAYOUT_DEFAULT
can be removed.bindings/odin/examples/clay-official-website/clay-official-website.odin
in this commitFull details of changelist will be enumerated in the
0.12
release.