Skip to content

Commit

Permalink
[Examples/clay-official-website] Update web renderer example to lates…
Browse files Browse the repository at this point in the history
…t API
  • Loading branch information
nicbarker committed Feb 10, 2025
1 parent dcd6fed commit 76c8e1f
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 304 deletions.
12 changes: 12 additions & 0 deletions clay.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ typedef struct {
void* customData;
} Clay_CustomRenderData;

typedef struct {
bool horizontal;
bool vertical;
} Clay_ScrollRenderData;

typedef struct {
Clay_Color color;
Clay_CornerRadius cornerRadius;
Expand All @@ -436,6 +441,7 @@ typedef union {
Clay_ImageRenderData image;
Clay_CustomRenderData custom;
Clay_BorderRenderData border;
Clay_ScrollRenderData scroll;
} Clay_RenderData;

// Miscellaneous Structs & Enums ---------------------------------
Expand Down Expand Up @@ -2249,6 +2255,12 @@ void Clay__CalculateFinalLayout(void) {
}
case CLAY__ELEMENT_CONFIG_TYPE_SCROLL: {
renderCommand.commandType = CLAY_RENDER_COMMAND_TYPE_SCISSOR_START;
renderCommand.renderData = CLAY__INIT(Clay_RenderData) {
.scroll = {
.horizontal = elementConfig->config.scrollElementConfig->horizontal,
.vertical = elementConfig->config.scrollElementConfig->vertical,
}
};
break;
}
case CLAY__ELEMENT_CONFIG_TYPE_IMAGE: {
Expand Down
Loading

0 comments on commit 76c8e1f

Please sign in to comment.