From 9417a2448483a46a6a45698c7d55017460bc109e Mon Sep 17 00:00:00 2001 From: YiQianYao <42212176+2912401452@users.noreply.github.com> Date: Wed, 15 Jun 2022 15:25:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=BB=E5=A4=84=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E8=8A=82=E6=B5=81=20(#1151)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/services/interaction/PickingService.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/core/src/services/interaction/PickingService.ts b/packages/core/src/services/interaction/PickingService.ts index a372549be1..6a2f6578e8 100644 --- a/packages/core/src/services/interaction/PickingService.ts +++ b/packages/core/src/services/interaction/PickingService.ts @@ -46,8 +46,6 @@ export default class PickingService implements IPickingService { private pickBufferScale: number = 1.0; - private lastPickTime: number = new Date().getTime(); - // Tip: 记录当前拾取中的 layers private pickedLayers: ILayer[] = []; @@ -209,17 +207,7 @@ export default class PickingService implements IPickingService { return; } this.alreadyInPicking = true; - const t = new Date().getTime(); - // TODO: 优化拾取操作 在右键时 mousedown 和 contextmenu 几乎同时触发,所以不能舍去这一次的触发 - if ( - t - this.lastPickTime > 10 || - ['contextmenu', 'click', 'dblclick', 'mouseup'].includes(target.type) - ) { - await this.pickingLayers(target); - } - // await this.pickingLayers(target); - // @ts-ignore - this.lastPickTime = t; + await this.pickingLayers(target); this.layerService.renderLayers(); this.alreadyInPicking = false; }