X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBoard.vue;h=9e23fc5697f136760e6462678cf62c70747d889a;hb=ded43c88fad60fd8f9bb46aabd67f3f2092f65f3;hp=b176bd73221d0e6abb0beb81a095ed69b023e4d1;hpb=cbe9537881e68f50c43f48d3699c4b248690fb4d;p=vchess.git diff --git a/client/src/components/Board.vue b/client/src/components/Board.vue index b176bd73..9e23fc56 100644 --- a/client/src/components/Board.vue +++ b/client/src/components/Board.vue @@ -194,7 +194,9 @@ export default { 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 }) @@ -365,7 +367,7 @@ export default { 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) @@ -575,11 +577,12 @@ export default { 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 = [];