Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect rotation matrix after selecting nodes #6978

Merged
merged 7 commits into from
Apr 13, 2023
Merged
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed unintended dependencies between segments of different volume layers which used the same segment id. Now, using the same segment id for segments in different volume layers should work without any problems. [#6960](https://github.com/scalableminds/webknossos/pull/6960)
- Fixed incorrect initial tab when clicking "Show Annotations" for a user in the user list. Also, the datasets tab was removed from that page as it was the same as the datasets table from the main dashboard. [#6957](https://github.com/scalableminds/webknossos/pull/6957)
- Fixed that unsaved changes were shown when opening an annotation, although there weren't any. [#6972](https://github.com/scalableminds/webknossos/pull/6972)
- Fixed rendering problems in orthogonal when working with nodes that were created in flight or oblique mode. [#6978](https://github.com/scalableminds/webknossos/pull/6978)

### Removed

Expand Down
5 changes: 4 additions & 1 deletion frontend/javascripts/oxalis/model/reducers/flycam_reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ export function setDirectionReducer(state: OxalisState, direction: Vector3) {
},
});
}

export function setRotationReducer(state: OxalisState, rotation: Vector3) {
if (state.dataset != null) {
// Don't change rotation in orthogonal mode, because this would lead to incorrect
// buckets being selected.
philippotto marked this conversation as resolved.
Show resolved Hide resolved
if (state.dataset != null && state.temporaryConfiguration.viewMode !== "orthogonal") {
const [x, y, z] = rotation;
let matrix = resetMatrix(state.flycam.currentMatrix, state.dataset.dataSource.scale);
matrix = rotateOnAxis(matrix, (-z * Math.PI) / 180, [0, 0, 1]);
Expand Down
3 changes: 3 additions & 0 deletions frontend/javascripts/test/reducers/flycam_reducer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const initialState = {
currentMatrix: M4x4.identity,
spaceDirectionOrtho: [1, 1, 1],
},
temporaryConfiguration: {
viewMode: "oblique",
},
};
test("Flycam should calculate zoomed matrix", (t) => {
t.deepEqual(
Expand Down