From 85ef9d8f2edde96a261fa685bdb8d0224feb7c1e Mon Sep 17 00:00:00 2001 From: Ergoold <34137153+Ergoold@users.noreply.github.com> Date: Wed, 7 Apr 2021 01:02:37 +0300 Subject: [PATCH] Fix ImageClearBackground (#1711) - Dividing by height instead of width results in missing parts of the image. --- src/textures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textures.c b/src/textures.c index c8a19be1f..5db786f62 100644 --- a/src/textures.c +++ b/src/textures.c @@ -2347,7 +2347,7 @@ Rectangle GetImageAlphaBorder(Image image, float threshold) // Clear image background with given color void ImageClearBackground(Image *dst, Color color) { - for (int i = 0; i < dst->width*dst->height; ++i) ImageDrawPixel(dst, i%dst->width, i/dst->height, color); + for (int i = 0; i < dst->width*dst->height; ++i) ImageDrawPixel(dst, i%dst->width, i/dst->width, color); } // Draw pixel within an image