mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
throttle take 3
This commit is contained in:
parent
6ecd843df2
commit
203de10249
1 changed files with 10 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue