Update renderScene.ts

This commit is contained in:
zsviczian 2023-04-04 10:49:48 +02:00 committed by GitHub
parent c7346e3a77
commit 11109fcc62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -407,7 +407,9 @@ export const _renderScene = ({
let editingLinearElement: NonDeleted<ExcalidrawLinearElement> | undefined = let editingLinearElement: NonDeleted<ExcalidrawLinearElement> | undefined =
undefined; undefined;
let i = 0; const start = Date.now();
const showDebug = !appState.shouldCacheIgnoreZoom && (appState.zoom.value < 0.5);
if(showDebug) console.log("start: renderElements");
visibleElements.forEach((element) => { visibleElements.forEach((element) => {
try { try {
renderElement(element, rc, context, renderConfig, appState); renderElement(element, rc, context, renderConfig, appState);
@ -427,7 +429,7 @@ export const _renderScene = ({
console.error(error); console.error(error);
} }
}); });
if(showDebug) console.log(`finish: renderElements ${Date.now()-start}`);
if (editingLinearElement) { if (editingLinearElement) {
renderLinearPointHandles( renderLinearPointHandles(
context, context,