mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 00:09:08 +02:00
Fix
This commit is contained in:
@@ -68,14 +68,10 @@ module.exports = class IllegalCommand extends Command {
|
|||||||
encoder.addFrame(ctx);
|
encoder.addFrame(ctx);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ctx.textBaseline = 'middle';
|
ctx.textBaseline = 'top';
|
||||||
ctx.font = '20px Impact';
|
ctx.font = '20px Impact';
|
||||||
ctx.textAlign = 'center';
|
|
||||||
const maxLen = frame.corners[1][0] - frame.corners[0][0];
|
const maxLen = frame.corners[1][0] - frame.corners[0][0];
|
||||||
const widthMid = frame.corners[0][0] + (maxLen / 2);
|
ctx.fillText(`${text}\n${verb} NOW\nILLEGAL`, frame.corners[0][0], frame.corners[0][1], maxLen);
|
||||||
const heightMid = frame.corners[0][1] + ((frame.corners[2][1] - frame.corners[0][1]) / 2);
|
|
||||||
console.log(widthMid, 'x', heightMid, 'x', maxLen);
|
|
||||||
ctx.fillText(`${text}\n${verb} NOW\nILLEGAL`, widthMid, heightMid, maxLen);
|
|
||||||
encoder.addFrame(ctx);
|
encoder.addFrame(ctx);
|
||||||
}
|
}
|
||||||
encoder.finish();
|
encoder.finish();
|
||||||
|
|||||||
Reference in New Issue
Block a user