From 0c361a252364a0681bfb3c9ce26a41a5ccede7fc Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Mon, 14 Apr 2025 13:51:29 -0700 Subject: [PATCH] StructureOutliner now updates correctly when instance moves --- scripts/classes/StructureOutliner.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/classes/StructureOutliner.js b/scripts/classes/StructureOutliner.js index fb31339..7e30a29 100644 --- a/scripts/classes/StructureOutliner.js +++ b/scripts/classes/StructureOutliner.js @@ -3,15 +3,24 @@ import { Outliner } from '../classes/Outliner'; export class StructureOutliner { constructor(instance) { this.instance = instance; - this.dimension = instance.getDimension(); - this.bounds = instance.getBounds(); - this.bounds.min = instance.toGlobalCoords(this.bounds.min); - this.bounds.max = instance.toGlobalCoords(this.bounds.max); + this.pullInstanceData(); this.outliner = new Outliner(this.dimension, this.bounds.min, this.bounds.max); this.refresh(); } + pullInstanceData() { + this.dimension = this.instance.getDimension(); + this.bounds = this.instance.getBounds(); + this.bounds.min = this.instance.toGlobalCoords(this.bounds.min); + this.bounds.max = this.instance.toGlobalCoords(this.bounds.max); + } + refresh() { + this.pullInstanceData(); + this.refreshDraw(); + } + + refreshDraw() { this.outliner.stopDraw(); if (!this.instance.isEnabled()) return;