From 060afd7d7b9777430b91fb0d17b8942a25c9d247 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 10 Oct 2019 10:57:06 +1100 Subject: [PATCH] Fix R/G/B not being clamped in Gradient_Blend --- src/Drawer2D.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Drawer2D.c b/src/Drawer2D.c index 68d80743e..053afe662 100644 --- a/src/Drawer2D.c +++ b/src/Drawer2D.c @@ -234,9 +234,9 @@ void Gradient_Blend(Bitmap* bmp, BitmapCol col, int blend, for (xx = 0; xx < width; xx++, dst++) { /* TODO: Not shift when multiplying */ - R = BitmapCol_R(col) + (BitmapCol_R(*dst) * blend) / 255; - G = BitmapCol_G(col) + (BitmapCol_G(*dst) * blend) / 255; - B = BitmapCol_B(col) + (BitmapCol_B(*dst) * blend) / 255; + R = BitmapCol_R(col) + (BitmapCol_R(*dst) * blend) / 255; Drawer2D_ClampPixel(R); + G = BitmapCol_G(col) + (BitmapCol_G(*dst) * blend) / 255; Drawer2D_ClampPixel(G); + B = BitmapCol_B(col) + (BitmapCol_B(*dst) * blend) / 255; Drawer2D_ClampPixel(B); *dst = BitmapCol_Make(R, G, B, 255); }