-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-type elements #34
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nicbarker
force-pushed
the
012-multi-configs
branch
2 times, most recently
from
October 7, 2024 06:37
1cbe843
to
fad1f53
Compare
nicbarker
force-pushed
the
012-multi-configs
branch
from
October 16, 2024 01:09
c98b47a
to
6fdabc8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.