图形状态处理添加异常捕获,不影响其他对象处理
This commit is contained in:
parent
643ec9bfaf
commit
d13ffcc041
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user