Draft Eightpieces rules. Fix display: PNG images + promotions on 2 lines
[vchess.git] / client / src / utils / printDiagram.js
index aebdc24..cc97939 100644 (file)
@@ -70,6 +70,7 @@ 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
   let boardDiv = "";
   const [startX, startY, inc] =
     orientation == "w" ? [0, 0, 1] : [V.size.x - 1, V.size.y - 1, -1];
@@ -87,8 +88,8 @@ export function getDiagram(args) {
         boardDiv +=
           "<img " +
           "src='/images/pieces/" +
-          V.getPpath(board[i][j]) +
-          ".svg' " +
+          vr.getPpath(board[i][j], null, null, orientation) +
+          V.IMAGE_EXTENSION + "' " +
           "class='piece'/>";
       }
       if (markArray.length > 0 && markArray[i][j])