Skip to content

Commit

Permalink
fix(datasource/graphene) disabling hide segment zero when activating …
Browse files Browse the repository at this point in the history
…multicut tool so 0 segments do not blend in with the multicut segment when the tool is active
  • Loading branch information
chrisj committed Dec 5, 2024
1 parent 1e8fdc9 commit d300c88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/datasource/graphene/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2837,12 +2837,14 @@ class MulticutSegmentsTool extends LayerTool<SegmentationUserLayer> {
const priorBaseSegmentHighlighting =
displayState.baseSegmentHighlighting.value;
const priorHighlightColor = displayState.highlightColor.value;
const priorHideSegmentZero = displayState.hideSegmentZero.value;

activation.bindInputEventMap(MULTICUT_SEGMENTS_INPUT_EVENT_MAP);
activation.registerDisposer(() => {
resetMulticutDisplay();
displayState.baseSegmentHighlighting.value = priorBaseSegmentHighlighting;
displayState.highlightColor.value = priorHighlightColor;
displayState.hideSegmentZero.value = priorHideSegmentZero;
});
const resetMulticutDisplay = () => {
resetTemporaryVisibleSegmentsState(segmentationGroupState);
Expand All @@ -2863,6 +2865,7 @@ class MulticutSegmentsTool extends LayerTool<SegmentationUserLayer> {
displayState.highlightColor.value = multicutState.blueGroup.value
? BLUE_COLOR_HIGHTLIGHT
: RED_COLOR_HIGHLIGHT;
displayState.hideSegmentZero.value = false;
segmentsState.useTemporaryVisibleSegments.value = true;
segmentsState.useTemporarySegmentEquivalences.value = true;
// add focus segment and red/blue segments
Expand Down

0 comments on commit d300c88

Please sign in to comment.