Sfoglia il codice sorgente

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 anni fa
parent
commit
9685d54291
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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());
 
     // 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);
 
     constexpr int notch_size = 3;