图形状态处理添加异常捕获,不影响其他对象处理

This commit is contained in:
walker 2023-08-04 11:11:05 +08:00
parent 643ec9bfaf
commit d13ffcc041

View File

@ -537,13 +537,18 @@ export class GraphicApp extends EventEmitter<GraphicAppEvents> {
state.code,
state.graphicType
);
if (!g) {
const template = this.getGraphicTemplatesByType(state.graphicType);
const g = template.new();
g.loadState(state);
this.addGraphics(g);
} else if (g.updateStates(state)) {
g.repaint();
try {
if (!g) {
const template = this.getGraphicTemplatesByType(state.graphicType);
const g = template.new();
g.loadState(state);
this.addGraphics(g);
} else if (g.updateStates(state)) {
g.repaint();
}
} catch (err) {
console.error('图形状态处理异常', g, state, err);
throw err;
}
});
}