diff options
| author | Rob Loach <[email protected]> | 2023-09-11 13:00:30 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-11 19:00:30 +0200 |
| commit | 30f8dd6e377ba022a70ebdbac78a10f5b27af0eb (patch) | |
| tree | 56d4c32c9208a719647434f751eda9ca99bbbebd /src | |
| parent | b8cd10264b6d34ff4b09ccdd0b0f7b254cf3b122 (diff) | |
| download | raylib-30f8dd6e377ba022a70ebdbac78a10f5b27af0eb.tar.gz raylib-30f8dd6e377ba022a70ebdbac78a10f5b27af0eb.zip | |
rtextures: Fix ImageDraw() source clipping when drawing beyond top left (#3306)
Diffstat (limited to 'src')
| -rw-r--r-- | src/rtextures.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtextures.c b/src/rtextures.c index 4e2fdbd9..c86ebac3 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -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; } |
