mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -60,10 +60,10 @@ module.exports = class MemeGenModernCommand extends Command {
|
||||
const base = await loadImage(body);
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.font = '23px Noto';
|
||||
ctx.font = '40px Noto';
|
||||
const lines = await wrapText(ctx, text, base.width - 10);
|
||||
const lineBreakLen = text.split('\n').length;
|
||||
const linesLen = (23 * lines.length) + (23 * (lineBreakLen - 1)) + (9 * lines.length) + (9 * (lineBreakLen - 1));
|
||||
const linesLen = (40 * lines.length) + (40 * (lineBreakLen - 1)) + (9 * lines.length) + (9 * (lineBreakLen - 1));
|
||||
canvas.height += linesLen;
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.fillStyle = 'white';
|
||||
|
||||
Reference in New Issue
Block a user