Skip to content

Commit

Permalink
fix: 修复重置逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
JessYan0913 committed Aug 23, 2023
1 parent b890d08 commit 0d9393b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ export class App extends BaseService<EventArgs> {

public clear(): void {
this.mainLayer.removeChildren();
this.selector.clear();
this.selector.destroy();
this.render();
this.selector = new Selector(this);
}

public async toDataURL(config?: {
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/services/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ export class Selector extends Service {
return this.transformer.getClientRect();
}

public clear(): void {
this.transformer.removeChildren();
this.optionLayer.clear();
this.selected.clear();
}

private onTransformStart = (): void => {
this.app.emit('node:transform:start', { nodes: [...this.selected.values()] });
this.app.emit('node:update:before', { nodes: [...this.selected.values()] });
Expand Down

0 comments on commit 0d9393b

Please sign in to comment.