mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-21 22:54:11 +08:00
fix(composer-emoji): Render emoji characters on Windows/Linux
This commit is contained in:
parent
6a151b4f14
commit
62b06121f6
1 changed files with 4 additions and 4 deletions
|
@ -269,10 +269,7 @@ class EmojiButtonPopover extends React.Component {
|
|||
ctx.fillStyle = 'black';
|
||||
if (this.state.categorizedEmoji[category].length === 0) return;
|
||||
this.state.categorizedEmoji[category].forEach((emojiName, j) => {
|
||||
if (process.platform === "darwin" && missingEmojiList.indexOf(emojiName) === -1) {
|
||||
const emojiChar = emoji.get(emojiName);
|
||||
ctx.fillText(emojiChar, position.x, position.y);
|
||||
} else {
|
||||
if (process.platform === "darwin" && missingEmojiList.indexOf(emojiName) !== -1) {
|
||||
const img = new Image();
|
||||
img.src = `images/composer-emoji/missing-emoji/${emojiName}.png`;
|
||||
const x = position.x;
|
||||
|
@ -280,6 +277,9 @@ class EmojiButtonPopover extends React.Component {
|
|||
img.onload = () => {
|
||||
ctx.drawImage(img, x, y - 30, 32, 32);
|
||||
}
|
||||
} else {
|
||||
const emojiChar = emoji.get(emojiName);
|
||||
ctx.fillText(emojiChar, position.x, position.y);
|
||||
}
|
||||
if (position.x > 325 && j < this.state.categorizedEmoji[category].length - 1) {
|
||||
position.x = 18;
|
||||
|
|
Loading…
Reference in a new issue