We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
d9e02ab fixes the image element's size, but not its parent's. This emits a 0x100 rectangle with a 100x100 image inside it:
#include <stdio.h> #define CLAY_IMPLEMENTATION #include "clay.h" int main( int argc, char ** argv ) { static char mem[ 10000000 ]; Clay_Arena arena = Clay_CreateArenaWithCapacityAndMemory( sizeof( mem ), mem ); Clay_Initialize( arena, { }, { } ); auto measure_text = []( Clay_StringSlice text, Clay_TextElementConfig * config, void * user_data ) -> Clay_Dimensions { return { 5, 5 }; }; Clay_SetMeasureTextFunction( measure_text, NULL ); Clay_SetLayoutDimensions( Clay_Dimensions { 100, 100 } ); Clay_BeginLayout(); CLAY( { .id = 1, .layout = { .sizing = { .width = CLAY_SIZING_FIT( 0.0f ), .height = CLAY_SIZING_PERCENT( 1.0f ) } }, .backgroundColor = { 255, 255, 255, 255 }, } ) { CLAY( { .id = 2, .layout = { .sizing = { .height = CLAY_SIZING_PERCENT( 1.0f ) } }, .image = { .imageData = mem, .sourceDimensions = { 1, 1 } }, } ) { } }; Clay_RenderCommandArray layout = Clay_EndLayout(); for( int32_t i = 0; i < layout.length; i++ ) { const Clay_BoundingBox & bounds = layout.internalArray[ i ].boundingBox; printf( "%d,%d %dx%d\n", int( bounds.x ), int( bounds.y ), int( bounds.width ), int( bounds.height ) ); } return 0; }
This does work if you make the child image FIXED/GROW size.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this! Cascading layout bugs are always the most likely to slip through, let's see if I can get it fixed 🙂
Sorry, something went wrong.
This is reasonably tricky to solve at the moment, are there any workaround or are you stuck?
You can use size = grow(99999) instead of 100% :)
edit: actually that seems to just be for this poc because the canvas is 100x100, still no rush on this though
No branches or pull requests
d9e02ab fixes the image element's size, but not its parent's. This emits a 0x100 rectangle with a 100x100 image inside it:
This does work if you make the child image FIXED/GROW size.
The text was updated successfully, but these errors were encountered: