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