diff --git a/examples/SDL3-simple-demo/main.c b/examples/SDL3-simple-demo/main.c index a1bfd15..4e74ab5 100644 --- a/examples/SDL3-simple-demo/main.c +++ b/examples/SDL3-simple-demo/main.c @@ -116,8 +116,8 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) int width, height; SDL_GetWindowSize(state->window, &width, &height); - Clay_SetMeasureTextFunction(SDL_MeasureText, 0); Clay_Initialize(clayMemory, (Clay_Dimensions) { (float) width, (float) height }, (Clay_ErrorHandler) { HandleClayErrors }); + Clay_SetMeasureTextFunction(SDL_MeasureText, 0); *appstate = state; return SDL_APP_CONTINUE; diff --git a/examples/raylib-sidebar-scrolling-container/main.c b/examples/raylib-sidebar-scrolling-container/main.c index 630eaa0..1b486d7 100644 --- a/examples/raylib-sidebar-scrolling-container/main.c +++ b/examples/raylib-sidebar-scrolling-container/main.c @@ -218,8 +218,8 @@ void HandleClayErrors(Clay_ErrorData errorData) { int main(void) { uint64_t totalMemorySize = Clay_MinMemorySize(); Clay_Arena clayMemory = Clay_CreateArenaWithCapacityAndMemory(totalMemorySize, malloc(totalMemorySize)); - Clay_SetMeasureTextFunction(Raylib_MeasureText, 0); Clay_Initialize(clayMemory, (Clay_Dimensions) { (float)GetScreenWidth(), (float)GetScreenHeight() }, (Clay_ErrorHandler) { HandleClayErrors }); + Clay_SetMeasureTextFunction(Raylib_MeasureText, 0); Clay_Raylib_Initialize(1024, 768, "Clay - Raylib Renderer Example", FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI | FLAG_MSAA_4X_HINT); profilePicture = LoadTextureFromImage(LoadImage("resources/profile-picture.png")); Raylib_fonts[FONT_ID_BODY_24] = (Raylib_Font) { diff --git a/renderers/cairo/clay_renderer_cairo.c b/renderers/cairo/clay_renderer_cairo.c index 5fceffb..c8e3c16 100644 --- a/renderers/cairo/clay_renderer_cairo.c +++ b/renderers/cairo/clay_renderer_cairo.c @@ -83,7 +83,7 @@ static inline char *Clay_Cairo__NullTerminate(Clay_String *str) { } // Measure text using cairo's *toy* text API. -static inline Clay_Dimensions Clay_Cairo_MeasureText(Clay_String *str, Clay_TextElementConfig *config) { +static inline Clay_Dimensions Clay_Cairo_MeasureText(Clay_String *str, Clay_TextElementConfig *config, uintptr_t userData) { // Edge case: Clay computes the width of a whitespace character // once. Cairo does not factor in whitespaces when computing text // extents, this edge-case serves as a short-circuit to introduce