diff options
Diffstat (limited to 'src/index.html.in')
-rw-r--r-- | src/index.html.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/index.html.in b/src/index.html.in index 119d646..46d39e4 100644 --- a/src/index.html.in +++ b/src/index.html.in @@ -118,7 +118,6 @@ async function main() { ctx.fillStyle = "#000000"; ctx.fillRect(0, 0, width, height); - console.log("frame"); for (let i = 0; i < len; i++) { let op = ops.subarray(7*i, 7*i+7); const color = new Uint8Array(new Uint32Array(op.subarray(4, 6)).buffer); @@ -128,9 +127,11 @@ async function main() { ctx.strokeStyle = `#${color[4].toString(16).padStart(2, "0")}${color[5].toString(16).padStart(2, "0")}${color[6].toString(16).padStart(2, "0")}`; ctx.globalAlpha = color[7] / 255; ctx.strokeRect(op[0], op[1], op[2], op[3]); - if (op[6] !== 0) { - ctx.globalAlpha = 1; - ctx.drawImage(images[op[6]], op[0], op[1], op[2], op[3]); + const image = new Uint8Array(new Uint32Array(op.subarray(6, 7)).buffer); + if (image[0] !== 0) { + console.log(image); + ctx.globalAlpha = image[1] / 255; + ctx.drawImage(images[image[0]], op[0], op[1], op[2], op[3]); } } } |