X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FprintDiagram.js;h=4239688accb921b2814c44cb19df5ce35aa39cf1;hb=81452d4dd5d64d93322c6ba090c6e357e65a68fb;hp=ebc4d1140da578524673eef71877ac11014df789;hpb=157a72c805261f68aa1adcd4776debf965d7e6cd;p=vchess.git diff --git a/client/src/utils/printDiagram.js b/client/src/utils/printDiagram.js index ebc4d114..4239688a 100644 --- a/client/src/utils/printDiagram.js +++ b/client/src/utils/printDiagram.js @@ -75,10 +75,12 @@ export function getDiagram(args) { const orientation = args.orientation || "w"; 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 += "
"; }