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