mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
LibGfx: Draw checkbox check in the center of the checkbox rect
This looks better at larger checkbox sizes than just drawing it in the top left corner. Ideally we'd have a scalable checkmark, of course.
This commit is contained in:
parent
ee001cc417
commit
460303b2fe
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2023, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020, Sarah Taube <metalflakecobaltpaint@gmail.com>
|
||||
* Copyright (c) 2021, Filiph Sandström <filiph.sandstrom@filfatstudios.com>
|
||||
* Copyright (c) 2022, Cameron Youell <cameronyouell@gmail.com>
|
||||
|
@ -563,7 +563,8 @@ void ClassicStylePainter::paint_check_box(Painter& painter, IntRect const& rect,
|
|||
}
|
||||
|
||||
if (is_checked) {
|
||||
painter.draw_bitmap(rect.shrunken(4, 4).location(), s_checked_bitmap, is_enabled ? palette.base_text() : palette.threed_shadow1());
|
||||
auto check_rect = Gfx::IntRect({}, s_checked_bitmap.size()).centered_within(rect);
|
||||
painter.draw_bitmap(check_rect.location(), s_checked_bitmap, is_enabled ? palette.base_text() : palette.threed_shadow1());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue