X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=variants%2FHex%2Fclass.js;h=db60da74843a76b47bfea0a6890592ad79236efe;hb=fcede3ef85cbb36a05220033cdd318af68e0084c;hp=91a0fe67ce89e3394388d004fc6a6588fca9c33f;hpb=437dfd42748eb2359103fd87a7d0e780121a7865;p=xogo.git diff --git a/variants/Hex/class.js b/variants/Hex/class.js index 91a0fe6..db60da7 100644 --- a/variants/Hex/class.js +++ b/variants/Hex/class.js @@ -78,24 +78,21 @@ export default class HexRules extends ChessRules { return (emptyCount + "/").repeat(this.size.x).slice(0, -1) + " w 0"; } - // TODO: enable vertical board (rotate?) getSvgChessboard() { // NOTE: with small margin seems nicer let width = 173.2 * this.size.y + 173.2 * (this.size.y-1) / 2 + 30, height = 50 + Math.floor(150 * this.size.x) + 30, min_x = -86.6 - 15, min_y = -100 - 15; -// if (this.size.ratio < 1) { -// [width, height] = [height, width]; -// [min_x, min_y] = [min_y, min_x]; -// } + if (this.size.ratio < 1) { + // Rotate by 30 degrees to display vertically + [width, height] = [height, width]; + [min_x, min_y] = [min_y, min_x]; + } let board = ` + class="chessboard_SVG"> `; - board += ""; + board += "`; } } - board += ``; + board += `