diff --git a/src/examples/app/index.ts b/src/examples/app/index.ts index f798109..5327f78 100644 --- a/src/examples/app/index.ts +++ b/src/examples/app/index.ts @@ -114,17 +114,17 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { return new TrainData(); }), ], - isSupportDeletion: (g): boolean => { - if (g.type === Signal.Type) { - Notify.create({ - type: 'warning', - message: '信号机不支持删除', - timeout: 1000, - }); - return false; - } - return true; - }, + // isSupportDeletion: (g): boolean => { + // if (g.type === Signal.Type) { + // Notify.create({ + // type: 'warning', + // message: '信号机不支持删除', + // timeout: 1000, + // }); + // return false; + // } + // return true; + // }, }); // 画布右键菜单 diff --git a/src/jlgraphic/app/JlGraphicApp.ts b/src/jlgraphic/app/JlGraphicApp.ts index 4be56ea..5cf08f3 100644 --- a/src/jlgraphic/app/JlGraphicApp.ts +++ b/src/jlgraphic/app/JlGraphicApp.ts @@ -737,7 +737,7 @@ export class GraphicApp extends EventEmitter { deleteGraphics(...graphics: JlGraphic[]): JlGraphic[] { const dels = graphics.filter((g) => { if ( - this._options?.isSupportDeletion && + this._options?.isSupportDeletion == undefined || this._options.isSupportDeletion(g) ) { this.doDeleteGraphics(g);