rtextures: Fix ImageDraw() source clipping when drawing beyond top left (#3306)

This commit is contained in:
Rob Loach 2023-09-11 13:00:30 -04:00 committed by GitHub
parent b8cd10264b
commit 30f8dd6e37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -3481,7 +3481,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
// Destination rectangle out-of-bounds security checks
if (dstRec.x < 0)
{
srcRec.x = -dstRec.x;
srcRec.x -= dstRec.x;
srcRec.width += dstRec.x;
dstRec.x = 0;
}
@ -3489,7 +3489,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
if (dstRec.y < 0)
{
srcRec.y = -dstRec.y;
srcRec.y -= dstRec.y;
srcRec.height += dstRec.y;
dstRec.y = 0;
}