Skip to content

Update to Twemoji 16 for Emoji 16 support #8774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve accuracy of empty check.
  • Loading branch information
peterwilsoncc committed May 8, 2025
commit b4b29e5a5566e152ce71525a3052af1e763ed219
11 changes: 9 additions & 2 deletions src/js/_enqueues/lib/emoji-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,16 @@
context.clearRect( 0, 0, context.canvas.width, context.canvas.height );
context.fillText( emoji, 0, 0 );

// Test if the center point (16, 16) is empty.
// Test if the center point (16, 16) is empty (0,0,0,0).
var centerPoint = context.getImageData(16, 16, 1, 1);
return centerPoint.data[0] === 0;
for ( var i = 0; i < centerPoint.data.length; i++ ) {
if ( centerPoint.data[ i ] !== 0 ) {
// Stop checking the moment it's known not to be empty.
return false;
}
}

return true;
}

/**
Expand Down