X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=variants%2FHex%2Fclass.js;h=ab634b8891e94b849295ba684f48aa592a8e8285;hp=37bd53c9792ae7b7e6e2556a40c25a1c4d1bb733;hb=a1b45f4c9f254fad73af06b4123b7208247bbba4;hpb=535c464b0543306a0ea36c66f07dcfad7a951efc diff --git a/variants/Hex/class.js b/variants/Hex/class.js index 37bd53c..ab634b8 100644 --- a/variants/Hex/class.js +++ b/variants/Hex/class.js @@ -78,14 +78,14 @@ export default class HexRules extends ChessRules { return (emptyCount + "/").repeat(this.size.x).slice(0, -1) + " w 0"; } - // TODO: re-enable rotation + // 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.rotate) { +// if (this.size.ratio < 1) { // [width, height] = [height, width]; // [min_x, min_y] = [min_y, min_x]; // } @@ -93,7 +93,7 @@ export default class HexRules extends ChessRules { @@ -177,14 +177,14 @@ export default class HexRules extends ChessRules { document.addEventListener("touchstart", mousedown, {passive: false}); } + // TODO: enable rotation get size() { const baseRatio = 1.619191; // 2801.2 / 1730, "widescreen" - const rotate = window.innerWidth < window.innerHeight; //"vertical screen" + const rotate = false; //window.innerWidth < window.innerHeight; //"vertical screen" return { x: this.options["bsize"], y: this.options["bsize"], - ratio: rotate ? 1 / baseRatio : baseRatio, - rotate: rotate + ratio: (rotate ? 1 / baseRatio : baseRatio) }; }