From 46e9170e0105d42e53b41aed2d49f0ec0aeabb3a Mon Sep 17 00:00:00 2001 From: Nic Barker Date: Tue, 4 Feb 2025 16:52:43 +1300 Subject: [PATCH] Fix image tint in raylib renderer on windows --- renderers/raylib/clay_renderer_raylib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renderers/raylib/clay_renderer_raylib.c b/renderers/raylib/clay_renderer_raylib.c index 71742ec..0dbc163 100644 --- a/renderers/raylib/clay_renderer_raylib.c +++ b/renderers/raylib/clay_renderer_raylib.c @@ -143,12 +143,16 @@ void Clay_Raylib_Render(Clay_RenderCommandArray renderCommands, Font* fonts) } case CLAY_RENDER_COMMAND_TYPE_IMAGE: { Texture2D imageTexture = *(Texture2D *)renderCommand->renderData.image.imageData; + Clay_Color tintColor = renderCommand->renderData.image.backgroundColor; + if (tintColor.r == 0 && tintColor.g == 0 || tintColor.b == 0 || tintColor.a == 0) { + tintColor = (Clay_Color) { 255, 255, 255, 255 }; + } DrawTextureEx( imageTexture, (Vector2){boundingBox.x, boundingBox.y}, 0, boundingBox.width / (float)imageTexture.width, - CLAY_COLOR_TO_RAYLIB_COLOR(renderCommand->renderData.image.backgroundColor)); + CLAY_COLOR_TO_RAYLIB_COLOR(tintColor)); break; } case CLAY_RENDER_COMMAND_TYPE_SCISSOR_START: {