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 layout persistence when switching between orthogonal, flight, and oblique mode #8177

Merged
merged 6 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed downloading task annotations of teams you are not in, when accessing directly via URI. [#8155](https://github.com/scalableminds/webknossos/pull/8155)
- Deleting a bounding box is now possible independently of a visible segmentation layer. [#8164](https://github.com/scalableminds/webknossos/pull/8164)
- S3-compliant object storages can now be accessed via HTTPS. [#8167](https://github.com/scalableminds/webknossos/pull/8167)
- Fixed a layout persistence bug leading to empty viewports, triggered when switching between orthogonal, flight, or oblique mode. [#8177](https://github.com/scalableminds/webknossos/pull/8177)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ class FlexLayoutWrapper extends React.PureComponent<Props, State> {
rebuildLayout() {
const model = this.loadCurrentModel();
this.updateToModelStateAndAdjustIt(model);
this.setState({
model,
});
setTimeout(this.onLayoutChange, 1);
this.setState(
{
model,
},
() => this.onLayoutChange(),
);
daniel-wer marked this conversation as resolved.
Show resolved Hide resolved

if (this.props.layoutName !== DEFAULT_LAYOUT_NAME) {
sendAnalyticsEvent("load_custom_layout", {
Expand Down
17 changes: 10 additions & 7 deletions frontend/javascripts/oxalis/view/layouting/tracing_layout_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ class TracingLayoutView extends React.PureComponent<PropsWithRouter, State> {
app.vent.emit("rerender");

if (model != null) {
this.setState({
model,
});
}

if (this.props.autoSaveLayouts) {
this.saveCurrentLayout(layoutName);
this.setState(
{
model,
},
() => {
if (this.props.autoSaveLayouts) {
this.saveCurrentLayout(layoutName);
daniel-wer marked this conversation as resolved.
Show resolved Hide resolved
}
},
);
daniel-wer marked this conversation as resolved.
Show resolved Hide resolved
}
};

Expand Down