mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 22:01:54 +02:00
Fix
This commit is contained in:
@@ -207,13 +207,13 @@ module.exports = class TweetCommand extends Command {
|
||||
const lineEmoji = line.match(emojiRegex());
|
||||
const height = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent;
|
||||
if (!lineEmoji) {
|
||||
ctx.fillText(line, x, y + height * currentLine);
|
||||
ctx.fillText(line, x, y + (height * currentLine));
|
||||
continue;
|
||||
}
|
||||
let currentX = x;
|
||||
for (let i = 0; i < lineNoEmoji.length; i++) {
|
||||
const linePart = lineNoEmoji[i];
|
||||
ctx.fillText(linePart, currentX, y + height * currentLine);
|
||||
ctx.fillText(linePart, currentX, y + (height * currentLine));
|
||||
currentX += ctx.measureText(linePart).width;
|
||||
const parsedEmoji = twemoji.parse(emoji[i]);
|
||||
if (!parsedEmoji.length || !parsedEmoji[0].url) continue;
|
||||
@@ -221,7 +221,7 @@ module.exports = class TweetCommand extends Command {
|
||||
const loadedEmoji = await loadImage(body);
|
||||
loadedEmoji.width = emojiSize;
|
||||
loadedEmoji.height = emojiSize;
|
||||
ctx.drawImage(loadedEmoji, currentX, y + height, emojiSize, emojiSize);
|
||||
ctx.drawImage(loadedEmoji, currentX, y + (height * currentLine), emojiSize, emojiSize);
|
||||
currentX += emojiSize;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user