From f0842815355e97dd89e224f33693166ef9880da0 Mon Sep 17 00:00:00 2001 From: Kleber Silva Date: Wed, 1 Sep 2021 20:16:19 -0300 Subject: [PATCH] skipping invisible objects --- TODO.todo | 4 ++-- src/scene/scene-editor.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TODO.todo b/TODO.todo index 63b7296..5181c3d 100644 --- a/TODO.todo +++ b/TODO.todo @@ -2,7 +2,7 @@ BASIC: Selection: [x] natural parent selection [x] global scale - [ ] skip invisible objects + [x] skip invisible objects Translation: [x] translation @@ -46,7 +46,6 @@ BASIC: General Features: [x] editor layout - [ ] hide panels [ ] undo / redo [ ] hide gizmos [ ] toggle enabled @@ -103,6 +102,7 @@ ADVANCED: [ ] help: keyboard shorcuts [ ] toolbar: tool selector [ ] status bar + [ ] hide panels Plugins Support: [ ] add plugin diff --git a/src/scene/scene-editor.ts b/src/scene/scene-editor.ts index 585e37d..0cd10e9 100644 --- a/src/scene/scene-editor.ts +++ b/src/scene/scene-editor.ts @@ -100,7 +100,7 @@ export class SceneEditor extends Phaser.Group { private getObjectsUnderPoint(x: number, y: number, children: PIXI.DisplayObject[], objects: PIXI.DisplayObject[]) { for (let i = children.length - 1; i >= 0; i--) { const child = children[i]; - if (child.__skip || !('getBounds' in child)) continue; + if (!child.visible || child.__skip || !('getBounds' in child)) continue; const bounds: PIXI.Rectangle = child.getBounds(); if ('children' in child) this.getObjectsUnderPoint(x, y, child.children, objects); if (bounds.contains(x, y)) objects.push(child);