mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-25 10:21:17 +02:00
throttle take 3
This commit is contained in:
@@ -6448,10 +6448,16 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
isExporting: false,
|
isExporting: false,
|
||||||
renderScrollbars: !this.device.isMobile,
|
renderScrollbars: !this.device.isMobile,
|
||||||
};
|
};
|
||||||
renderingElements.forEach((el) =>
|
let i = 0;
|
||||||
setTimeout(() => generateElementWithCanvas(el, renderConfig)),
|
for (; i < renderingElements.length; i += 200) {
|
||||||
);
|
const chunk = renderingElements.slice(i, i + 200);
|
||||||
setTimeout(() => this.setState({ shouldCacheIgnoreZoom: false }));
|
setTimeout(
|
||||||
|
() =>
|
||||||
|
chunk.forEach((el) => generateElementWithCanvas(el, renderConfig)),
|
||||||
|
i * 50,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
setTimeout(() => this.setState({ shouldCacheIgnoreZoom: false }), i * 50);
|
||||||
}
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user