Skip to content

Commit

Permalink
Stack viewer: allow multiple stack layers for non-primary stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
aschampion committed Nov 8, 2018
1 parent dfde1da commit a4f9a4c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion django/applications/catmaid/static/js/stack-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,17 @@
if (StackViewer.Settings.session.respect_broken_sections_new_stacks) {
this._brokenSliceStacks.add(stack);
}
this.addLayer('StackLayer' + stack.id, layer);

// Create a unique key for this layer.
let base_key = 'StackLayer' + stack.id;
var key = base_key;
var duplicate = 1;
while (this._layers.has(key)) {
key = base_key + '-' + duplicate;
duplicate += 1;
}

this.addLayer(key, layer);
if (this._tool) {
this._tool.unregister(this);
this._tool.register(this);
Expand Down

0 comments on commit a4f9a4c

Please sign in to comment.