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