First version of complete Chakart rules (unfinished). Draft diagramer (missing marks...
[xogo.git] / variants / Hex / class.js
index 8721227..80d4501 100644 (file)
@@ -35,6 +35,9 @@ export default class HexRules extends ChessRules {
   get noAnimate() {
     return true;
   }
+  get clickOnly() {
+    return true;
+  }
 
   doClick(coords) {
     if (
@@ -162,7 +165,9 @@ export default class HexRules extends ChessRules {
 
   get size() {
     const baseRatio = 1.6191907514450865; //2801.2 / 1730, "widescreen"
-    const rotate = window.innerWidth < window.innerHeight; //"vertical screen"
+    const rc =
+      document.getElementById(this.containerid).getBoundingClientRect();
+    const rotate = rc.width < rc.height; //"vertical screen"
     return {
       x: this.options["bsize"],
       y: this.options["bsize"],