X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FprintDiagram.js;h=ef0d2b55f528b823823450c8c87bd3760a71697f;hb=2a2936023cda0888e215ff699d420090372899b0;hp=524e12bca3d67c3affcdb3af4baa4fbadbc9ec63;hpb=e50a802531b99829c533f22ecd21e359e7e1e049;p=vchess.git diff --git a/client/src/utils/printDiagram.js b/client/src/utils/printDiagram.js index 524e12bc..ef0d2b55 100644 --- a/client/src/utils/printDiagram.js +++ b/client/src/utils/printDiagram.js @@ -73,6 +73,7 @@ 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 @@ -90,8 +91,16 @@ export function getDiagram(args) { (V.Notoodark ? "middle-square" : "dark-square"); if (j == startY) boardDiv += " border-left"; } - else if ((i + j) % 2 == 0) boardDiv += "light-square"; - else boardDiv += "dark-square"; + else { + const oddity = (i + j) % 2; + if ( + (oddity == 0 && !V.DarkBottomRight) || + (oddity == 1 && V.DarkBottomRight) + ) { + boardDiv += "light-square"; + } + else boardDiv += "dark-square"; + } boardDiv += " " + store.state.settings.bcolor; if (shadowArray.length > 0 && shadowArray[i][j]) boardDiv += " in-shadow";