diff --git a/frontend/apps/editor3d/app/src/Helpers/CanvasHelpers.ts b/frontend/apps/editor3d/app/src/Helpers/CanvasHelpers.ts index 5457215006..54a1265ef5 100644 --- a/frontend/apps/editor3d/app/src/Helpers/CanvasHelpers.ts +++ b/frontend/apps/editor3d/app/src/Helpers/CanvasHelpers.ts @@ -1,12 +1,12 @@ -export const normalizeCanvas = (canvas: HTMLCanvasElement, width: number, height: number): HTMLCanvasElement => { - const newCanvas = document.createElement("canvas"); +export const normalizeCanvas = (canvas: HTMLCanvasElement, width: number, height: number): OffscreenCanvas => { + const newCanvas = new OffscreenCanvas(width, height); newCanvas.width = width; newCanvas.height = height; const ctx = newCanvas.getContext("2d"); if (!ctx) { - throw new Error("Failed to get canvas context"); + throw new Error("Failed to get offscreen canvas context"); } ctx.imageSmoothingEnabled = true;