StructureOutliner now updates correctly when instance moves
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user