From 7e81643156529065354151af2f9e8045cd9b4f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=B1=AA=E7=8F=A3?= <519367854@qq.com> Date: Thu, 4 Apr 2024 16:48:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(module:=20widgets):=20=E6=B7=BB=E5=8A=A0mo?= =?UTF-8?q?use=20click=20=E9=A9=B1=E5=8A=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/widgets/aux-tool/selection.widget.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/components/widgets/aux-tool/selection.widget.ts b/src/app/components/widgets/aux-tool/selection.widget.ts index 4c4c15b..f8ab41e 100644 --- a/src/app/components/widgets/aux-tool/selection.widget.ts +++ b/src/app/components/widgets/aux-tool/selection.widget.ts @@ -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 { @@ -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(); - }); } }