mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 03:18:14 +00:00
rtextures: Fix ImageDraw() source clipping when drawing beyond top left (#3306)
This commit is contained in:
@@ -3481,7 +3481,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
|
|||||||
// Destination rectangle out-of-bounds security checks
|
// Destination rectangle out-of-bounds security checks
|
||||||
if (dstRec.x < 0)
|
if (dstRec.x < 0)
|
||||||
{
|
{
|
||||||
srcRec.x = -dstRec.x;
|
srcRec.x -= dstRec.x;
|
||||||
srcRec.width += dstRec.x;
|
srcRec.width += dstRec.x;
|
||||||
dstRec.x = 0;
|
dstRec.x = 0;
|
||||||
}
|
}
|
||||||
@@ -3489,7 +3489,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
|
|||||||
|
|
||||||
if (dstRec.y < 0)
|
if (dstRec.y < 0)
|
||||||
{
|
{
|
||||||
srcRec.y = -dstRec.y;
|
srcRec.y -= dstRec.y;
|
||||||
srcRec.height += dstRec.y;
|
srcRec.height += dstRec.y;
|
||||||
dstRec.y = 0;
|
dstRec.y = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user