From 123766305ef06d1dbfe8d7807d135bf950061ded Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Sun, 7 Mar 2021 01:02:32 +0100 Subject: [PATCH] improve RectAreaLight --- src/lights/RectAreaLight.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lights/RectAreaLight.js b/src/lights/RectAreaLight.js index e625736..a154a47 100644 --- a/src/lights/RectAreaLight.js +++ b/src/lights/RectAreaLight.js @@ -21,8 +21,15 @@ export default { }); }); - if (this.helper) this.$parent.add(new RectAreaLightHelper(this.light)); + if (this.helper) { + this.lightHelper = new RectAreaLightHelper(this.light); + this.$parent.add(this.lightHelper); + } + this.initLight(); }, + unmounted() { + if (this.lightHelper) this.$parent.remove(this.lightHelper); + }, __hmrId: 'RectAreaLight', };