mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-25 08:39:18 -05:00
DrawTextureRec() function review to allow flipped rectangle
This commit is contained in:
@ -1206,7 +1206,7 @@ void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float sc
|
|||||||
// Draw a part of a texture (defined by a rectangle)
|
// Draw a part of a texture (defined by a rectangle)
|
||||||
void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint)
|
void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint)
|
||||||
{
|
{
|
||||||
Rectangle destRec = { (int)position.x, (int)position.y, sourceRec.width, sourceRec.height };
|
Rectangle destRec = { (int)position.x, (int)position.y, abs(sourceRec.width), abs(sourceRec.height) };
|
||||||
Vector2 origin = { 0, 0 };
|
Vector2 origin = { 0, 0 };
|
||||||
|
|
||||||
DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint);
|
DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint);
|
||||||
|
|||||||
Reference in New Issue
Block a user