This commit is contained in:
Dragon Fire
2024-04-26 01:09:13 -04:00
parent 5b4c629f4e
commit 89c7b4b7b0
+2 -1
View File
@@ -70,7 +70,8 @@ module.exports = class TweetCommand extends Command {
const ctx = canvas.getContext('2d');
ctx.font = this.client.fonts.get('ChirpRegular.ttf').toCanvasString(23);
const lines = wrapText(ctx, text, 710);
const linesLen = (23 * lines.length) + (7 * (lines.length - 1)) + 15;
const metrics = ctx.measureText(lines.join('\n'));
const linesLen = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent + 15;
canvas.height += linesLen;
let imageHeight = 0;
ctx.fillStyle = 'black';