mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 22:10:48 +02:00
Moved minimap rendering to offscreen canvas
This commit is contained in:
@@ -32,7 +32,10 @@ export const exportToCanvas = (
|
||||
createCanvas: (
|
||||
width: number,
|
||||
height: number,
|
||||
) => { canvas: HTMLCanvasElement; scale: number } = (width, height) => {
|
||||
) => { canvas: HTMLCanvasElement | OffscreenCanvas; scale: number } = (
|
||||
width,
|
||||
height,
|
||||
) => {
|
||||
const tempCanvas = document.createElement("canvas");
|
||||
tempCanvas.width = width * scale;
|
||||
tempCanvas.height = height * scale;
|
||||
@@ -57,7 +60,7 @@ export const exportToCanvas = (
|
||||
appState,
|
||||
null,
|
||||
newScale,
|
||||
rough.canvas(tempCanvas),
|
||||
rough.canvas((tempCanvas as unknown) as HTMLCanvasElement),
|
||||
tempCanvas,
|
||||
{
|
||||
viewBackgroundColor: exportBackground ? viewBackgroundColor : null,
|
||||
|
Reference in New Issue
Block a user