Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
### Changed

### Fixed

- Fixed a bug that lead to trees being dropped when merging to trees together. [#8359](https://github.com/scalableminds/webknossos/pull/8359)

### Removed
- Removed the feature to downsample existing volume annotations. All new volume annotations had a whole mag stack since [#4755](https://github.com/scalableminds/webknossos/pull/4755) (four years ago). [#7917](https://github.com/scalableminds/webknossos/pull/7917)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,8 @@ function SkeletonTracingReducer(state: OxalisState, action: Action): OxalisState
const isProofreadingActive =
state.uiInformation.activeTool === AnnotationToolEnum.PROOFREAD;
const treeType = isProofreadingActive ? TreeTypeEnum.AGGLOMERATE : TreeTypeEnum.DEFAULT;
const oldTrees = getTreesWithType(skeletonTracing, treeType);
const mergeResult = mergeTrees(oldTrees, sourceNodeId, targetNodeId);
const oldTrees = skeletonTracing.trees;
const mergeResult = mergeTrees(oldTrees, sourceNodeId, targetNodeId, treeType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

if (mergeResult == null) {
return state;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,19 @@ export function mergeTrees(
trees: TreeMap,
sourceNodeId: number,
targetNodeId: number,
treeType: TreeType,
): [TreeMap, number, number] | null {
// targetTree will be removed (the content will be merged into sourceTree).
const sourceTree = findTreeByNodeId(trees, sourceNodeId); // should be activeTree, so that the active tree "survives"
const targetTree = findTreeByNodeId(trees, targetNodeId);

if (targetTree == null || sourceTree == null || targetTree === sourceTree) {
if (
targetTree == null ||
sourceTree == null ||
targetTree === sourceTree ||
sourceTree.type !== treeType ||
targetTree.type !== treeType
) {
return null;
}

Expand Down
Loading