mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 16:19:12 +02:00
Fix
This commit is contained in:
@@ -204,12 +204,16 @@ module.exports = class ChessCommand extends Command {
|
|||||||
const img = this.images[parsed.color][parsed.name];
|
const img = this.images[parsed.color][parsed.name];
|
||||||
const { x, y, width, height } = centerImagePart(img, 61, 61, w, h);
|
const { x, y, width, height } = centerImagePart(img, 61, 61, w, h);
|
||||||
if (prevPieces && (!prevGamePiece || piece !== prevGamePiece)) {
|
if (prevPieces && (!prevGamePiece || piece !== prevGamePiece)) {
|
||||||
drawImageWithTint(ctx, img, 'green', x, y, width, height);
|
ctx.fillStyle = 'yellow';
|
||||||
|
ctx.globalAlpha = 0.5;
|
||||||
|
ctx.fillRect(w, h, 61, 61);
|
||||||
|
ctx.globalAlpha = 1;
|
||||||
|
ctx.drawImage(img, x, y, width, height);
|
||||||
} else {
|
} else {
|
||||||
ctx.drawImage(img, x, y, width, height);
|
ctx.drawImage(img, x, y, width, height);
|
||||||
}
|
}
|
||||||
} else if (prevGamePiece) {
|
} else if (prevGamePiece) {
|
||||||
ctx.fillStyle = 'green';
|
ctx.fillStyle = 'yellow';
|
||||||
ctx.globalAlpha = 0.5;
|
ctx.globalAlpha = 0.5;
|
||||||
ctx.fillRect(w, h, 61, 61);
|
ctx.fillRect(w, h, 61, 61);
|
||||||
ctx.globalAlpha = 1;
|
ctx.globalAlpha = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user