diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-20 18:40:48 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-20 20:55:29 +0200 |
commit | 6a012ad79f95673a36531c27c81e0efa6c6ec664 (patch) | |
tree | 54777eacd8382e76f87d578e57ac080cb531c0e1 /Userland/Games/Chess | |
parent | 068ddf4513281c0aa183552273b3b9a811b78263 (diff) | |
download | serenity-6a012ad79f95673a36531c27c81e0efa6c6ec664.zip |
LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
Diffstat (limited to 'Userland/Games/Chess')
-rw-r--r-- | Userland/Games/Chess/ChessWidget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index 92921bb6be..db1e05fb56 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -41,6 +41,8 @@ void ChessWidget::paint_event(GUI::PaintEvent& event) Chess::Board& active_board = (m_playback ? board_playback() : board()); + auto& coordinate_font = Gfx::FontDatabase::default_font().bold_variant(); + Chess::Square::for_each([&](Chess::Square sq) { Gfx::IntRect tile_rect; if (side() == Chess::Color::White) { @@ -62,10 +64,10 @@ void ChessWidget::paint_event(GUI::PaintEvent& event) auto shrunken_rect = tile_rect; shrunken_rect.shrink(4, 4); if (sq.rank == coord_rank_file) - painter.draw_text(shrunken_rect, coord.substring_view(0, 1), Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::BottomRight, text_color); + painter.draw_text(shrunken_rect, coord.substring_view(0, 1), coordinate_font, Gfx::TextAlignment::BottomRight, text_color); if (sq.file == coord_rank_file) - painter.draw_text(shrunken_rect, coord.substring_view(1, 1), Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::TopLeft, text_color); + painter.draw_text(shrunken_rect, coord.substring_view(1, 1), coordinate_font, Gfx::TextAlignment::TopLeft, text_color); } for (auto& m : m_board_markings) { |