mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 08:14:47 +02:00
Fix
This commit is contained in:
@@ -77,12 +77,15 @@ module.exports = class EjectCommand extends Command {
|
||||
const frameID = `frame_${i.toString().padStart(2, '0')}.gif`;
|
||||
const frame = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'eject', frameID));
|
||||
if (i <= 11) {
|
||||
const rotation = (360 / 10) * i;
|
||||
const x = ((320 / 10) * i) + (rotation / 4);
|
||||
const y = ((frame.height / 2) - 25) - (rotation / 4);
|
||||
ctx.drawImage(frame, 0, 0);
|
||||
ctx.rotate(rotation * (Math.PI / 180));
|
||||
ctx.drawImage(avatar, x, y, 50, 50);
|
||||
const rotation = (360 / 10) * i;
|
||||
const x = (320 / 10) * i;
|
||||
const y = (frame.height / 2) - 25;
|
||||
const angle = rotation * (Math.PI / 180);
|
||||
ctx.rotate(angle);
|
||||
const x2 = x + (x * Math.cos(angle));
|
||||
const y2 = y + (x * Math.sin(angle));
|
||||
ctx.drawImage(avatar, x2, y2, 50, 50);
|
||||
ctx.rotate(-rotation * (Math.PI / 180));
|
||||
}
|
||||
if (i > 10) {
|
||||
|
||||
Reference in New Issue
Block a user