mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-19 04:38:01 +00:00
fix up examples
This commit is contained in:
parent
d0d96777a6
commit
4c6c71b3fc
@ -402,7 +402,7 @@ Clay_RenderCommandArray CreateLayout(bool mobileScreen, float lerpValue) {
|
|||||||
float scrollHeight = scrollData.scrollContainerDimensions.height - 12;
|
float scrollHeight = scrollData.scrollContainerDimensions.height - 12;
|
||||||
CLAY({
|
CLAY({
|
||||||
.id = CLAY_ID("ScrollBar"),
|
.id = CLAY_ID("ScrollBar"),
|
||||||
.floating = { .offset = { .x = -6, .y = -(scrollData.scrollPosition->y / scrollData.contentDimensions.height) * scrollHeight + 6}, .zIndex = 1, .parentId = Clay_GetElementId(CLAY_STRING("OuterScrollContainer")).id, .attachment = {.element = CLAY_ATTACH_POINT_RIGHT_TOP, .parent = CLAY_ATTACH_POINT_RIGHT_TOP }},
|
.floating = { .offset = { .x = -6, .y = -(scrollData.scrollPosition->y / scrollData.contentDimensions.height) * scrollHeight + 6}, .zIndex = 1, .parentId = Clay_GetElementId(CLAY_STRING("OuterScrollContainer")).id, .attachPoints = {.element = CLAY_ATTACH_POINT_RIGHT_TOP, .parent = CLAY_ATTACH_POINT_RIGHT_TOP }, .attachTo = CLAY_ATTACH_TO_PARENT },
|
||||||
.layout = { .sizing = {CLAY_SIZING_FIXED(10), CLAY_SIZING_FIXED((scrollHeight / scrollData.contentDimensions.height) * scrollHeight)} },
|
.layout = { .sizing = {CLAY_SIZING_FIXED(10), CLAY_SIZING_FIXED((scrollHeight / scrollData.contentDimensions.height) * scrollHeight)} },
|
||||||
.backgroundColor = scrollbarColor,
|
.backgroundColor = scrollbarColor,
|
||||||
.cornerRadius = CLAY_CORNER_RADIUS(5)
|
.cornerRadius = CLAY_CORNER_RADIUS(5)
|
||||||
|
@ -147,7 +147,8 @@ Clay_RenderCommandArray ClayVideoDemo_CreateLayout(ClayVideoDemo_Data *data) {
|
|||||||
if (fileMenuVisible) { // Below has been changed slightly to fix the small bug where the menu would dismiss when mousing over the top gap
|
if (fileMenuVisible) { // Below has been changed slightly to fix the small bug where the menu would dismiss when mousing over the top gap
|
||||||
CLAY({ .id = CLAY_ID("FileMenu"),
|
CLAY({ .id = CLAY_ID("FileMenu"),
|
||||||
.floating = {
|
.floating = {
|
||||||
.attachment = {
|
.attachTo = CLAY_ATTACH_TO_PARENT,
|
||||||
|
.attachPoints = {
|
||||||
.parent = CLAY_ATTACH_POINT_LEFT_BOTTOM
|
.parent = CLAY_ATTACH_POINT_LEFT_BOTTOM
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user