fix: handle render errors (#3557)
This commit is contained in:
parent
91ab7f36e2
commit
6bebfe63be
@ -206,7 +206,7 @@ const drawElementOnCanvas = (
|
|||||||
context.canvas.remove();
|
context.canvas.remove();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error(`Unimplemented type ${element.type}`);
|
throw new Error(`Unimplemented type ${element.type}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,11 @@ export const renderScene = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
visibleElements.forEach((element) => {
|
visibleElements.forEach((element) => {
|
||||||
renderElement(element, rc, context, renderOptimizations, sceneState);
|
try {
|
||||||
|
renderElement(element, rc, context, renderOptimizations, sceneState);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (appState.editingLinearElement) {
|
if (appState.editingLinearElement) {
|
||||||
@ -283,13 +287,17 @@ export const renderScene = (
|
|||||||
|
|
||||||
// Paint selection element
|
// Paint selection element
|
||||||
if (selectionElement) {
|
if (selectionElement) {
|
||||||
renderElement(
|
try {
|
||||||
selectionElement,
|
renderElement(
|
||||||
rc,
|
selectionElement,
|
||||||
context,
|
rc,
|
||||||
renderOptimizations,
|
context,
|
||||||
sceneState,
|
renderOptimizations,
|
||||||
);
|
sceneState,
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBindingEnabled(appState)) {
|
if (isBindingEnabled(appState)) {
|
||||||
@ -834,13 +842,17 @@ export const renderSceneToSvg = (
|
|||||||
// render elements
|
// render elements
|
||||||
elements.forEach((element) => {
|
elements.forEach((element) => {
|
||||||
if (!element.isDeleted) {
|
if (!element.isDeleted) {
|
||||||
renderElementToSvg(
|
try {
|
||||||
element,
|
renderElementToSvg(
|
||||||
rsvg,
|
element,
|
||||||
svgRoot,
|
rsvg,
|
||||||
element.x + offsetX,
|
svgRoot,
|
||||||
element.y + offsetY,
|
element.x + offsetX,
|
||||||
);
|
element.y + offsetY,
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user