X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FprintDiagram.js;h=4239688accb921b2814c44cb19df5ce35aa39cf1;hb=81452d4dd5d64d93322c6ba090c6e357e65a68fb;hp=ef0d2b55f528b823823450c8c87bd3760a71697f;hpb=2a2936023cda0888e215ff699d420090372899b0;p=vchess.git diff --git a/client/src/utils/printDiagram.js b/client/src/utils/printDiagram.js index ef0d2b55..4239688a 100644 --- a/client/src/utils/printDiagram.js +++ b/client/src/utils/printDiagram.js @@ -73,13 +73,14 @@ export function getDiagram(args) { // Obtain the array of pieces images names: const board = V.GetBoard(args.position); const orientation = args.orientation || "w"; - const darkBottomRight = !!args.darkBottomRight; const markArray = getMarkArray(args.marks); const shadowArray = getShadowArray(args.shadow); - const vr = new V(); //just for pieces images paths + const vr = new V(); //TODO: just for pieces images paths let boardDiv = ""; const [startX, startY, inc] = orientation == "w" ? [0, 0, 1] : [V.size.x - 1, V.size.y - 1, -1]; + let lightOddity = (V.size.x + V.size.y) % 2; + if (V.DarkBottomRight) lightOddity = 1 - lightOddity; for (let i = startX; i >= 0 && i < V.size.x; i += inc) { boardDiv += "
"; }