mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-14 10:18:03 +00:00
Fix image tint in raylib renderer on windows
This commit is contained in:
parent
e8fe2e5270
commit
46e9170e01
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user