From dddc181e51c1f24c4a3770e167d768eca5c3ae17 Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Fri, 7 Feb 2025 19:14:17 +0800 Subject: [PATCH] =?UTF-8?q?pick=E6=97=B6=EF=BC=8C=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E9=9D=9E=E5=B8=B8=E5=A4=A7=E3=80=81=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=B8=B2=E6=9F=93=E5=86=85=E5=AE=B9=E7=9A=84=E8=8A=82?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/inject/hint/hint-v3.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/scripts/inject/hint/hint-v3.ts b/src/scripts/inject/hint/hint-v3.ts index d844707..7886fbd 100644 --- a/src/scripts/inject/hint/hint-v3.ts +++ b/src/scripts/inject/hint/hint-v3.ts @@ -18,9 +18,20 @@ export class HintV3 extends HintAdapter { // 因为Canvas会全屏,所以暂时不拾取,会干扰体验 return false; } + const tr = node.getComponent(this.transformComponent); + if (tr) { + const size = cc.view.getVisibleSize(); + if (tr.width >= size.width || tr.height >= size.height) { + // 节点的区域非常大,并且没有渲染组件,在界面上看不到任何内容,也忽略掉 + // 有些背景遮罩使用的是单色透明图片,这种情况暂时没有好办法过滤掉 + const renderComp = [cc.Sprite, cc.Label].find((comp) => node.getComponent(comp)); + if (!renderComp) { + return false; + } + } + } let hitTest = null; - const tr = node.getComponent(this.transformComponent); if (tr) { if (tr.hitTest) { hitTest = tr.hitTest.bind(tr);