Revert "wip"

This reverts commit 36e3b75cab.
This commit is contained in:
tamaina 2023-05-17 07:55:01 +00:00
parent 36e3b75cab
commit 6bed74109b
2 changed files with 1 additions and 3 deletions

View File

@ -136,8 +136,6 @@ async function draw() {
worker.postMessage({ worker.postMessage({
id: viewId, id: viewId,
hash: props.hash, hash: props.hash,
width: canvasWidth,
height: canvasHeight,
}); });
} else { } else {
try { try {

View File

@ -8,7 +8,7 @@ onmessage = async (event) => {
if (!('hash' in event.data && typeof event.data.hash === 'string')) { if (!('hash' in event.data && typeof event.data.hash === 'string')) {
return; return;
} }
const work = new OffscreenCanvas(event.data.width ?? 64, event.data.height ?? 64); const work = new OffscreenCanvas(canvas.width, canvas.height);
render(event.data.hash, work); render(event.data.hash, work);
const bitmap = await createImageBitmap(work); const bitmap = await createImageBitmap(work);
postMessage({ id: event.data.id, bitmap }); postMessage({ id: event.data.id, bitmap });