From 0e4ebaf89df19a3cbf3fb8c9215e94dfb1344d9b Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 15 Sep 2024 13:20:43 +0200 Subject: [PATCH] REVIEWED: `DrawTexturePro()` to avoid negative dest rec #4316 --- src/rtextures.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rtextures.c b/src/rtextures.c index 8bda75ad..6d3c21cf 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4565,6 +4565,9 @@ void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 if (source.width < 0) { flipX = true; source.width *= -1; } if (source.height < 0) source.y -= source.height; + + if (dest.width < 0) dest.width *= -1; + if (dest.height < 0) dest.height *= -1; Vector2 topLeft = { 0 }; Vector2 topRight = { 0 };