Skip to content

Commit

Permalink
feat(module: widgets): 添加mouse click 驱动类
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeard30 committed Apr 4, 2024
1 parent f15c74e commit 7e81643
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/app/components/widgets/aux-tool/selection.widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export class SelectionBoxWidget implements OnChanges, AfterViewInit {

ngAfterViewInit(): void {
fromEvent(window, 'resize').subscribe(() => this.update());
fromEvent(window, 'mouseup')
.pipe(debounceTime(100))
.subscribe(() => this.update());
}

ngOnChanges(changes: SimpleChanges): void {
Expand Down Expand Up @@ -124,11 +127,5 @@ export class SelectionWidget {
fromEvent(window, 'mouseup')
.pipe(debounceTime(100))
.subscribe(() => this.cdr.detectChanges());
fromEvent(window, 'mousedown')
.pipe(debounceTime(100))
.subscribe(() => {
console.log('selection>>>', this.selection);
this.cdr.detectChanges();
});
}
}

0 comments on commit 7e81643

Please sign in to comment.