Last active
December 10, 2024 13:07
-
-
Save JobLeonard/8765ea2a96e2a418b001d9e80be9db82 to your computer and use it in GitHub Desktop.
Firefox larger than 128px canvas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bug-in-github-api-content-can-not-be-empty*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas width=420 height=220 style="image-rendering:pixelated;width:840px;height:440px"></canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const canvas = document.querySelector("canvas"); | |
const ctx = canvas.getContext("2d"); | |
ctx.fillStyle = "black"; | |
ctx.fillRect(0, 0, 21, 11); | |
ctx.fillStyle = "white"; | |
ctx.fillRect(1, 1, 9, 9); | |
ctx.fillRect(11, 1, 9, 9); | |
ctx.strokeStyle = ctx.fillStyle = "black"; | |
ctx.lineWidth = 1; | |
ctx.beginPath(); | |
ctx.arc(5.5, 5.5, 2.5, 0, Math.PI * 2); | |
ctx.fill(); | |
ctx.beginPath(); | |
ctx.arc(5.5, 5.5, 3.5, 0, Math.PI * 2); | |
ctx.stroke(); | |
ctx.beginPath(); | |
ctx.arc(15.5, 5.5, 2.5, 0, Math.PI * 2); | |
ctx.fill(); | |
ctx.beginPath(); | |
ctx.arc(16, 6, 3.5, 0, Math.PI * 2); | |
ctx.stroke(); | |
ctx.imageSmoothingEnabled = false; | |
ctx.drawImage(canvas, 0, 0, 420 * 20 , 220 * 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"Firefox larger than 128px canvas","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment