Skip to content

Commit

Permalink
Fix rendering when switching visibility between multiple volume layers (
Browse files Browse the repository at this point in the history
#7291)

* fix rendering when switching visibility between multiple volume layers

* update changelog
  • Loading branch information
philippotto authored Aug 17, 2023
1 parent 2bbc261 commit 2485549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed that folders could appear in the dataset search output in the dashboard. [#7232](https://github.com/scalableminds/webknossos/pull/7232)
- Fixed that the edit icon for an annotation description could disappear in Firefox. [#7250](https://github.com/scalableminds/webknossos/pull/7250)
- Fixed that assigning an invalid script name (e.g. with special characters) would trigger an error in the database. Now leads to a more descriptive error. [#7525](https://github.com/scalableminds/webknossos/pull/7525)
- Fixed rendering error when multiple segmentation layers exist and the user switched between these. [#7291](https://github.com/scalableminds/webknossos/pull/7291)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ class PlaneMaterialFactory {
// The third parameter returns the number of globally available layers (this is not always equal
// to the sum of the lengths of the first two arrays, as not all layers might be rendered.)
const state = Store.getState();
const sanitizedOrderedColorLayerNames =
const allSanitizedOrderedColorLayerNames =
state.datasetConfiguration.colorLayerOrder.map(sanitizeName);
const colorLayerNames = getSanitizedColorLayerNames();
const segmentationLayerNames = Model.getSegmentationLayers().map((layer) =>
Expand All @@ -938,7 +938,7 @@ class PlaneMaterialFactory {
return [
colorLayerNames,
segmentationLayerNames,
sanitizedOrderedColorLayerNames,
allSanitizedOrderedColorLayerNames,
globalLayerCount,
];
}
Expand Down Expand Up @@ -971,11 +971,12 @@ class PlaneMaterialFactory {
names,
({ isSegmentationLayer }) => !isSegmentationLayer,
).map((layers) => layers.map(({ name }) => sanitizeName(name)));
const colorNameSet = new Set(sanitizedColorLayerNames);

return [
sanitizedColorLayerNames,
sanitizedSegmentationLayerNames,
sanitizedOrderedColorLayerNames,
allSanitizedOrderedColorLayerNames.filter((name) => colorNameSet.has(name)),
globalLayerCount,
];
}
Expand Down

0 comments on commit 2485549

Please sign in to comment.