From a54aed9b890345dedc6dd431c457e596c7812f23 Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 12 Sep 2024 20:00:20 -0500 Subject: [PATCH] perf: skip debug render --- app/react/components/pixi/entity.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/react/components/pixi/entity.js b/app/react/components/pixi/entity.js index e6523de..f3b1d70 100644 --- a/app/react/components/pixi/entity.js +++ b/app/react/components/pixi/entity.js @@ -177,14 +177,16 @@ export default class Entity { } } } - if (this.entity.Collider) { - this.colliderAabb.redraw(this.entity.Collider.aabb); - } - if (VisibleAabb) { - this.visibleAabb.redraw(this.entity.VisibleAabb); - } - if (this.isMainEntity) { - this.interactionAabb.redraw(this.entity.Interacts.aabb()); + if (this.debug.alpha) { + if (this.entity.Collider) { + this.colliderAabb.redraw(this.entity.Collider.aabb); + } + if (VisibleAabb) { + this.visibleAabb.redraw(this.entity.VisibleAabb); + } + if (this.isMainEntity) { + this.interactionAabb.redraw(this.entity.Interacts.aabb()); + } } if (this.attached || !container) { return;