mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibGUI: Fix 1px misalignment of ColorButton selections in ColorPicker
Also use shrunken() to calculate the selection rects.
This commit is contained in:
parent
a2ffe95a8c
commit
18c67b4002
Notes:
sideshowbarker
2024-07-19 02:06:32 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/18c67b40020 Pull-request: https://github.com/SerenityOS/serenity/pull/3659
1 changed files with 4 additions and 4 deletions
|
@ -443,12 +443,12 @@ void ColorButton::paint_event(PaintEvent& event)
|
|||
|
||||
Gfx::StylePainter::paint_button(painter, rect(), palette(), Gfx::ButtonStyle::Normal, is_being_pressed(), is_hovered(), is_checked(), is_enabled());
|
||||
|
||||
painter.fill_rect({ 1, 1, rect().width() - 2, rect().height() - 2 }, m_color);
|
||||
painter.fill_rect(rect().shrunken(2, 2), m_color);
|
||||
|
||||
if (m_selected) {
|
||||
painter.fill_rect({ 3, 3, rect().width() - 6, rect().height() - 6 }, Color::Black);
|
||||
painter.fill_rect({ 5, 5, rect().width() - 10, rect().height() - 10 }, Color::White);
|
||||
painter.fill_rect({ 7, 6, rect().width() - 14, rect().height() - 14 }, m_color);
|
||||
painter.fill_rect(rect().shrunken(6, 6), Color::Black);
|
||||
painter.fill_rect(rect().shrunken(10, 10), Color::White);
|
||||
painter.fill_rect(rect().shrunken(14, 14), m_color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue