Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/chessboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ function expandConfig() {

// calculates square size based on the width of the container
// got a little CSS black magic here, so let me explain:
// get the width of the container element (could be anything), reduce by 1 for
// fudge factor, and then keep reducing until we find an exact mod 8 for
// our square size
// get the width of the container element (could be anything), reduce by border
// size, and then keep reducing until we find an exact mod 8 for our square
// size
function calculateSquareSize() {
var containerWidth = parseInt(containerEl.css('width'), 10);

Expand All @@ -507,7 +507,7 @@ function calculateSquareSize() {
}

// pad one pixel
var boardWidth = containerWidth - 1;
var boardWidth = containerWidth - BOARD_BORDER_SIZE * 2;

while (boardWidth % 8 !== 0 && boardWidth > 0) {
boardWidth--;
Expand Down