mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Fix
This commit is contained in:
@@ -49,12 +49,12 @@ module.exports = class PeriodicTableCommand extends Command {
|
|||||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||||
ctx.fillStyle = 'white';
|
ctx.fillStyle = 'white';
|
||||||
ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
|
ctx.fillRect(10, 10, canvas.width - 20, canvas.height - 20);
|
||||||
|
ctx.textAlign = 'center';
|
||||||
if (element.number === 0) {
|
if (element.number === 0) {
|
||||||
const batman = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'batman.png'));
|
const batman = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'batman.png'));
|
||||||
ctx.drawImage(batman, 100, 166);
|
ctx.drawImage(batman, 100, 166);
|
||||||
} else {
|
} else {
|
||||||
ctx.font = '210px Noto';
|
ctx.font = '210px Noto';
|
||||||
ctx.textAlign = 'center';
|
|
||||||
ctx.fillStyle = colors[element.phase];
|
ctx.fillStyle = colors[element.phase];
|
||||||
ctx.fillText(element.symbol, 250, 320);
|
ctx.fillText(element.symbol, 250, 320);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user