This commit is contained in:
Dragon Fire
2024-04-21 17:50:01 -04:00
parent 3cf7d25048
commit dad4951326
+1 -6
View File
@@ -70,12 +70,7 @@ module.exports = class TweetCommand extends Command {
const ctx = canvas.getContext('2d');
ctx.font = this.client.fonts.get('ChirpRegular.ttf').toCanvasString(23);
const lines = await wrapText(ctx, text, 710);
const lineBreakLen = text.split('\n').length;
const linesLen = (23 * lines.length)
+ (23 * (lineBreakLen - 1))
+ (9 * (lines.length - 1))
+ (9 * (lineBreakLen - 1))
+ 15;
const linesLen = (23 * lines.length) + (9 * (lines.length - 1)) + 15;
canvas.height += linesLen;
let imageHeight = 0;
ctx.fillStyle = 'black';