Просмотр исходного кода

LibGUI: Ensure final stop of the opacity slider gradient has 255 alpha

Otherwise, if you change the opacity in the color picker, the slider's
opacity changes.
MacDue 2 лет назад
Родитель
Сommit
9685d54291
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Userland/Libraries/LibGUI/OpacitySlider.cpp

+ 1 - 1
Userland/Libraries/LibGUI/OpacitySlider.cpp

@@ -41,7 +41,7 @@ void OpacitySlider::paint_event(PaintEvent& event)
     Gfx::StylePainter::paint_transparency_grid(painter, inner_rect, palette());
     Gfx::StylePainter::paint_transparency_grid(painter, inner_rect, palette());
 
 
     // Alpha gradient
     // Alpha gradient
-    painter.fill_rect_with_linear_gradient(inner_rect, Array { Gfx::ColorStop { Color::Transparent, 0 }, Gfx::ColorStop { m_base_color, 1 } },
+    painter.fill_rect_with_linear_gradient(inner_rect, Array { Gfx::ColorStop { Color::Transparent, 0 }, Gfx::ColorStop { m_base_color.with_alpha(255), 1 } },
         orientation() == Orientation::Horizontal ? 90.0f : 180.0f);
         orientation() == Orientation::Horizontal ? 90.0f : 180.0f);
 
 
     constexpr int notch_size = 3;
     constexpr int notch_size = 3;