StructureOutliner now updates correctly when instance moves
This commit is contained in:
@@ -3,15 +3,24 @@ import { Outliner } from '../classes/Outliner';
|
|||||||
export class StructureOutliner {
|
export class StructureOutliner {
|
||||||
constructor(instance) {
|
constructor(instance) {
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
this.dimension = instance.getDimension();
|
this.pullInstanceData();
|
||||||
this.bounds = instance.getBounds();
|
|
||||||
this.bounds.min = instance.toGlobalCoords(this.bounds.min);
|
|
||||||
this.bounds.max = instance.toGlobalCoords(this.bounds.max);
|
|
||||||
this.outliner = new Outliner(this.dimension, this.bounds.min, this.bounds.max);
|
this.outliner = new Outliner(this.dimension, this.bounds.min, this.bounds.max);
|
||||||
this.refresh();
|
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() {
|
refresh() {
|
||||||
|
this.pullInstanceData();
|
||||||
|
this.refreshDraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshDraw() {
|
||||||
this.outliner.stopDraw();
|
this.outliner.stopDraw();
|
||||||
if (!this.instance.isEnabled())
|
if (!this.instance.isEnabled())
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user