diff --git a/src/kiri/stack.js b/src/kiri/stack.js index 73f0b3dd..62b2286b 100644 --- a/src/kiri/stack.js +++ b/src/kiri/stack.js @@ -5,12 +5,12 @@ (function() { class Stack { - constructor(view) { + constructor(view, freeMem) { this._view = view; this.view = view.newGroup(); this.slices = []; this.meshes = []; - this.freeMem = true; + this.freeMem = freeMem; } size() { @@ -36,6 +36,10 @@ this.view = this.slices = this.meshes = null; } + setFreeMem(bool) { + this.freeMem = bool; + } + setVisible(newMin, newMax) { this.show(); for (let i=0, s=this.slices, len=s.length; i stack.obj.setFreeMem(bool)); freeMem = bool; return this; } @@ -57,7 +58,7 @@ } const stack = stacks[name] = { layers: [ ], - obj: new KIRI.Stack(view), + obj: new KIRI.Stack(view, freeMem), add: function(layers) { let map = stack.obj.addLayers(layers); for (const [label, mats] of Object.entries(map)) {