REVIEWED: ImageDraw() #1283

This commit is contained in:
raysan5 2020-06-20 18:10:21 +02:00
parent 0e26d514b8
commit da582e2eec

View file

@ -2553,7 +2553,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
srcRec.width += dstRec.x; srcRec.width += dstRec.x;
dstRec.x = 0; dstRec.x = 0;
} }
else if ((dstRec.x + srcPtr->width) > dst->width) srcRec.width = dst->width - dstRec.x; else if ((dstRec.x + srcRec.width) > dst->width) srcRec.width = dst->width - dstRec.x;
if (dstRec.y < 0) if (dstRec.y < 0)
{ {
@ -2561,7 +2561,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
srcRec.height += dstRec.y; srcRec.height += dstRec.y;
dstRec.y = 0; dstRec.y = 0;
} }
else if ((dstRec.y + srcPtr->height) > dst->height) srcRec.height = dst->height - dstRec.y; else if ((dstRec.y + srcRec.height) > dst->height) srcRec.height = dst->height - dstRec.y;
if (dst->width < srcRec.width) srcRec.width = dst->width; if (dst->width < srcRec.width) srcRec.width = dst->width;
if (dst->height < srcRec.height) srcRec.height = dst->height; if (dst->height < srcRec.height) srcRec.height = dst->height;