mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -70,7 +70,9 @@ module.exports = class SpongebobTimeCardCommand extends Command {
|
||||
let fontSize = 345;
|
||||
ctx.font = this.client.fonts.get('Spongeboytt1.ttf').toCanvasString(fontSize);
|
||||
let lines = wrapText(ctx, text.toUpperCase(), 1800);
|
||||
let longestLine = ctx.measureText(lines.sort((a, b) => ctx.measureText(b).width - ctx.measureText(a).width)[0]).width;
|
||||
let longestLine = ctx.measureText(
|
||||
lines.sort((a, b) => ctx.measureText(b).width - ctx.measureText(a).width)[0]
|
||||
).width;
|
||||
let heightMetric = measureTextHeightWithBreaks(ctx, lines.join('\n'));
|
||||
while (longestLine > 1800 || heightMetric > 1000) {
|
||||
fontSize -= 10;
|
||||
|
||||
Reference in New Issue
Block a user