1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibGfx: Fix constructor initialisation style in GradientPainting

This commit is contained in:
MacDue 2023-01-29 13:29:55 +00:00 committed by Linus Groh
parent 285bd7a37a
commit d11baf48ae

View file

@ -53,10 +53,10 @@ enum class UsePremultipliedAlpha {
class GradientLine {
public:
GradientLine(int gradient_length, Span<ColorStop const> color_stops, Optional<float> repeat_length, UsePremultipliedAlpha use_premultiplied_alpha = UsePremultipliedAlpha::Yes)
: m_repeating { repeat_length.has_value() }
, m_start_offset { round_to<int>((m_repeating ? color_stops.first().position : 0.0f) * gradient_length) }
, m_color_stops { color_stops }
, m_use_premultiplied_alpha { use_premultiplied_alpha }
: m_repeating(repeat_length.has_value())
, m_start_offset(round_to<int>((m_repeating ? color_stops.first().position : 0.0f) * gradient_length))
, m_color_stops(color_stops)
, m_use_premultiplied_alpha(use_premultiplied_alpha)
{
// Avoid generating excessive amounts of colors when the not enough shades to fill that length.
auto necessary_length = min<int>((color_stops.size() - 1) * 255, gradient_length);