Fix ImageClearBackground

- Dividing by height instead of width results in missing parts of the image.
This commit is contained in:
Ergoold 2021-04-07 00:22:10 +03:00 committed by GitHub
parent 84d0d21f23
commit 545fccbd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2347,7 +2347,7 @@ Rectangle GetImageAlphaBorder(Image image, float threshold)
// Clear image background with given color // Clear image background with given color
void ImageClearBackground(Image *dst, Color 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 // Draw pixel within an image