Skip to content
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

[BUG] CLAY_SIZING_GROW() is not working as expected. #72

Open
MiraiMindz opened this issue Dec 21, 2024 · 0 comments
Open

[BUG] CLAY_SIZING_GROW() is not working as expected. #72

MiraiMindz opened this issue Dec 21, 2024 · 0 comments

Comments

@MiraiMindz
Copy link

CLAY_SIZING_GROW() or CLAY_SIZING_GROW({}),`are not working as expected, grow to the full size of parent container / screen.

here is the code:

Clay_RenderCommandArray CreateLayout() {
    Clay_BeginLayout();
    CLAY(
        CLAY_RECTANGLE({ .color = {255, 0, 0, 255} }),
        CLAY_LAYOUT({
            .sizing = {
                .width = CLAY_SIZING_GROW(),
                .height = CLAY_SIZING_GROW(),
            }
        })
    ) {};
    return Clay_EndLayout();
}

void UpdateDrawFrame(void) {
    Clay_RenderCommandArray renderCommands = CreateLayout();

    /* BEGIN RENDERER */
    BeginDrawing();
    ClearBackground(BLACK);
    Clay_Raylib_Render(renderCommands);
    EndDrawing();
    /* END RENDERER */
}

Output:

image

It should create a RED tainted window as of in the demo video: https://youtu.be/DYWTw19_8r4?si=Y2OoF5lRb-gkYXRB&t=1128 or like the screenshot below:

image

the current work-around is to call GetScreenWidth(), and GetScreenHeight() from RayLib (or the equivalent of your renderer).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant