mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
[Core] Improve handling of aspect ratio scaling
This commit is contained in:
parent
d6f3957a60
commit
0431f862f4
2 changed files with 32 additions and 13 deletions
|
|
@ -174,11 +174,12 @@ void Clay_Raylib_Render(Clay_RenderCommandArray renderCommands, Font* fonts)
|
|||
if (tintColor.r == 0 && tintColor.g == 0 && tintColor.b == 0 && tintColor.a == 0) {
|
||||
tintColor = (Clay_Color) { 255, 255, 255, 255 };
|
||||
}
|
||||
DrawTextureEx(
|
||||
DrawTexturePro(
|
||||
imageTexture,
|
||||
(Vector2){boundingBox.x, boundingBox.y},
|
||||
(Rectangle) { 0, 0, imageTexture.width, imageTexture.height },
|
||||
(Rectangle){boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height},
|
||||
(Vector2) {},
|
||||
0,
|
||||
boundingBox.width / (float)imageTexture.width,
|
||||
CLAY_COLOR_TO_RAYLIB_COLOR(tintColor));
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue