diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-15 23:22:10 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-15 23:24:07 +0100 |
commit | 4839f36f5ed688cb56171a50e11845f7a44cf0c4 (patch) | |
tree | 141420a04e0f4772a05edaf2c4edc4fcb5519f4c | |
parent | 71f50b6e94845cda078f08fbdc8a1cf19cc5d086 (diff) | |
download | serenity-4839f36f5ed688cb56171a50e11845f7a44cf0c4.zip |
LibGUI: Fix OpacitySlider hairline disappearing towards the left
Whoops, we were scaling the alpha channel of the hairline color along
with the RGB channels.
-rw-r--r-- | Userland/Libraries/LibGUI/OpacitySlider.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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)); |