public int getPixelSize(int boardWidth, int boardHeight) {
        Dimension maxCanvas = getMaxCanvas();
        int pixelWidth = maxCanvas.width / boardWidth;
        int pixelHeight = maxCanvas.height / boardHeight;
        int pixelSize;
        if (pixelWidth <= pixelHeight) {
            pixelSize = pixelWidth;
        } else {
            pixelSize = pixelHeight;
        }
        return pixelSize;
    }