From 4839f36f5ed688cb56171a50e11845f7a44cf0c4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 15 Jan 2021 23:22:10 +0100 Subject: LibGUI: Fix OpacitySlider hairline disappearing towards the left Whoops, we were scaling the alpha channel of the hairline color along with the RGB channels. --- Userland/Libraries/LibGUI/OpacitySlider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibGUI') diff --git a/Userland/Libraries/LibGUI/OpacitySlider.cpp b/Userland/Libraries/LibGUI/OpacitySlider.cpp index 2766226203..d32002f479 100644 --- a/Userland/Libraries/LibGUI/OpacitySlider.cpp +++ b/Userland/Libraries/LibGUI/OpacitySlider.cpp @@ -105,9 +105,9 @@ void OpacitySlider::paint_event(PaintEvent& event) // We adjust the hairline's x position so it lines up with the shadow/highlight of the notches. u8 h = ((float)value() / (float)max()) * 255.0f; if (h < 128) - painter.draw_line({ notch_x, notch_y_top }, { notch_x, notch_y_bottom }, Color(h, h, h, h)); + painter.draw_line({ notch_x, notch_y_top }, { notch_x, notch_y_bottom }, Color(h, h, h, 255)); else - painter.draw_line({ notch_x - 1, notch_y_top }, { notch_x - 1, notch_y_bottom }, Color(h, h, h, h)); + painter.draw_line({ notch_x - 1, notch_y_top }, { notch_x - 1, notch_y_bottom }, Color(h, h, h, 255)); // Text label auto percent_text = String::formatted("{}%", (int)((float)value() / (float)max() * 100.0f)); -- cgit v1.2.3