LibGfx+LibGUI: Add support for vertical ProgressBars

This commit is contained in:
thankyouverycool 2021-03-07 17:39:01 -05:00 committed by Andreas Kling
commit 5806630cf4
Notes: sideshowbarker 2024-07-18 21:30:06 +09:00
7 changed files with 60 additions and 13 deletions

View file

@ -245,7 +245,7 @@ void Painter::fill_rect_with_gradient(Orientation orientation, const IntRect& 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_start, gradient_end, c);
auto color = gamma_accurate_blend(gradient_end, gradient_start, c);
color.set_alpha(c_alpha);
for (int j = 0; j < clipped_rect.width(); ++j) {
dst[j] = color.value();