Skip to content

Commit c68f0f0

Browse files
committed
Fix rotation in pieces area
1 parent aed2ee1 commit c68f0f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/renderers/_base.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9352,6 +9352,7 @@ export abstract class RendererBase {
93529352
// Width in number of cells, taking the maximum board width
93539353
const boardWidth = Math.floor(box.width / this.cellsize);
93549354
placeY = boardBottom + padding;
9355+
const rotation = this.getRotation();
93559356
for (let iArea = 0; iArea < areas.length; iArea++) {
93569357
const area = areas[iArea];
93579358
let hpad = 0;
@@ -9402,7 +9403,7 @@ export abstract class RendererBase {
94029403
}
94039404
const newx = (col * (cellsize + hpad)) + (cellsize / 2);
94049405
const newy = (textHeight * 2) + (row * (cellsize+hpad)) + (cellsize / 2);
9405-
const use = usePieceAt({svg: nested, piece, cellsize, x: newx, y: newy, scalingFactor: 1});
9406+
const use = usePieceAt({svg: nested, piece, cellsize, x: newx, y: newy, scalingFactor: 1}).rotate(rotation);
94069407
if (this.options.boardClick !== undefined) {
94079408
use.click((e: Event) => {this.options.boardClick!(-1, -1, p); e.stopPropagation();});
94089409
}

0 commit comments

Comments
 (0)