mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 21:40:51 +02:00
Fix
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = class FontCommand extends Command {
|
|||||||
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(50);
|
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(50);
|
||||||
const len = ctxPre.measureText(text);
|
const len = ctxPre.measureText(text);
|
||||||
const lines = wrapText(ctxPre, text, 950);
|
const lines = wrapText(ctxPre, text, 950);
|
||||||
const height = measureTextHeightWithBreaks(ctx, text);
|
const height = measureTextHeightWithBreaks(ctxPre, text);
|
||||||
const canvas = createCanvas(Math.min(len.width + 50, 1000), 50 + height);
|
const canvas = createCanvas(Math.min(len.width + 50, 1000), 50 + height);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.font = this.client.fonts.get(font.filename).toCanvasString(50);
|
ctx.font = this.client.fonts.get(font.filename).toCanvasString(50);
|
||||||
|
|||||||
Reference in New Issue
Block a user