From eef148f7e73020cc10205170165ad1435088c67d Mon Sep 17 00:00:00 2001 From: MacDue Date: Tue, 12 Jul 2022 00:36:09 +0100 Subject: LibGfx: Fix direction of vertical gradients Previously the color blending and alpha blending were working from opposite sides. --- Userland/Libraries/LibGfx/Painter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries') diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index ef277a5878..c968a04991 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -265,7 +265,7 @@ void Painter::fill_rect_with_gradient(Orientation orientation, IntRect const& a_ float c = offset * increment; float c_alpha = gradient_start.alpha() + offset * alpha_increment; for (int i = clipped_rect.height() - 1; i >= 0; --i) { - auto color = gamma_accurate_blend(gradient_end, gradient_start, c); + auto color = gamma_accurate_blend(gradient_start, gradient_end, c); color.set_alpha(c_alpha); for (int j = 0; j < clipped_rect.width(); ++j) { dst[j] = Color::from_argb(dst[j]).blend(color).value(); -- cgit v1.2.3