diff --git a/Userland/Applications/GamesSettings/ChessSettingsWidget.cpp b/Userland/Applications/GamesSettings/ChessSettingsWidget.cpp index 8ebc130dd2..7f4ef88f17 100644 --- a/Userland/Applications/GamesSettings/ChessSettingsWidget.cpp +++ b/Userland/Applications/GamesSettings/ChessSettingsWidget.cpp @@ -163,6 +163,7 @@ private: // With the same preview size as we use for card games, a nice fit is 2 ranks of 6. // There are definitely better ways of doing this, but it'll do. ;^) auto square_size = 61; + auto square_margin = square_size / 10; auto rect_for_square = [&](Chess::Square const& square) { return Gfx::IntRect { @@ -196,7 +197,7 @@ private: auto draw_piece = [&](Chess::Piece const& piece, Chess::Square const& square) { auto& bitmap = *m_piece_images.get(piece).value(); painter.draw_scaled_bitmap( - rect_for_square(square), + rect_for_square(square).shrunken(square_margin, square_margin, square_margin, square_margin), bitmap, bitmap.rect(), 1.0f, diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index e0fc2c2314..f44981ca14 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -41,6 +41,7 @@ void ChessWidget::paint_event(GUI::PaintEvent& event) auto square_width = min_size / 8; auto square_height = min_size / 8; + auto square_margin = square_width / 10; int coord_rank_file = (side() == Chess::Color::White) ? 0 : 7; Chess::Board& active_board = (m_playback ? board_playback() : board()); @@ -84,7 +85,7 @@ void ChessWidget::paint_event(GUI::PaintEvent& event) if (!(m_dragging_piece && sq == m_moving_square)) { auto bmp = m_pieces.get(active_board.get_piece(sq)); if (bmp.has_value()) { - painter.draw_scaled_bitmap(tile_rect, *bmp.value(), bmp.value()->rect(), 1.0f, Gfx::Painter::ScalingMode::BilinearBlend); + painter.draw_scaled_bitmap(tile_rect.shrunken(square_margin, square_margin, square_margin, square_margin), *bmp.value(), bmp.value()->rect(), 1.0f, Gfx::Painter::ScalingMode::BilinearBlend); } }