Skip to content

Commit 9cba886

Browse files
committed
Fix label selection
1 parent c434769 commit 9cba886

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/state.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ export const layerAtoms = atom((get) => {
168168
return layers.flatMap((layer) => {
169169
let inner: Array<VizarrLayer> = !layer.on ? [] : [new layer.Layer(layer.layerProps)];
170170
if (layer.imageLabel) {
171-
const { Layer, layerProps } = layer.imageLabel;
172-
const imageLabelLayers = layerProps.map((props) => new Layer(props));
171+
const { Layer, layerProps, channelIndex } = layer.imageLabel;
172+
const selection = layer.layerProps.selections[0].with(channelIndex, 0);
173+
const imageLabelLayers = layerProps.map((props) => new Layer({ ...props, selection }));
173174
inner.push(...imageLabelLayers);
174175
}
175176
return inner;

0 commit comments

Comments
 (0)