showCheck && lightSquare && incheckSq[ci][cj],
"incheck-dark":
showCheck && !lightSquare && incheckSq[ci][cj],
- "hover-highlight": this.vr.hoverHighlight(ci, cj)
+ "hover-highlight":
+ this.vr.hoverHighlight(
+ [ci, cj], !this.analyze ? this.userColor : null)
},
attrs: {
id: getSquareId({ x: ci, y: cj })
const squareWidth = boardElt.offsetWidth / sizeY;
const offset = [boardElt.offsetTop, boardElt.offsetLeft];
const maxNbeltsPerRow = Math.min(this.choices.length, sizeY);
- let topOffset = offset[0] + (sizeY / 2) * squareWidth - squareWidth / 2;
+ let topOffset = offset[0] + ((sizeX - 1) / 2) * squareWidth;
let choicesHeight = squareWidth;
if (this.choices.length >= sizeY) {
// A second row is required (Eightpieces variant)
return path;
},
re_setDrawings: function() {
+ // Add some drawing on board (for some variants + arrows and circles)
+ const boardElt = document.getElementById("gamePosition");
+ if (!boardElt) return;
// Remove current canvas, if any
const curCanvas = document.getElementById("arrowCanvas");
if (!!curCanvas) curCanvas.parentNode.removeChild(curCanvas);
- // Add some drawing on board (for some variants + arrows and circles)
- const boardElt = document.getElementById("gamePosition");
const squareWidth = boardElt.offsetWidth / V.size.y;
const bPos = boardElt.getBoundingClientRect();
let svgArrows = [];