mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
LibGfx: Fix direction of vertical gradients
Previously the color blending and alpha blending were working from opposite sides.
This commit is contained in:
parent
03037cbe4e
commit
eef148f7e7
1 changed files with 1 additions and 1 deletions
|
@ -265,7 +265,7 @@ void Painter::fill_rect_with_gradient(Orientation orientation, IntRect const& a_
|
||||||
float c = offset * increment;
|
float c = offset * increment;
|
||||||
float c_alpha = gradient_start.alpha() + offset * alpha_increment;
|
float c_alpha = gradient_start.alpha() + offset * alpha_increment;
|
||||||
for (int i = clipped_rect.height() - 1; i >= 0; --i) {
|
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);
|
color.set_alpha(c_alpha);
|
||||||
for (int j = 0; j < clipped_rect.width(); ++j) {
|
for (int j = 0; j < clipped_rect.width(); ++j) {
|
||||||
dst[j] = Color::from_argb(dst[j]).blend(color).value();
|
dst[j] = Color::from_argb(dst[j]).blend(color).value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue