Skip to content
Snippets Groups Projects
Commit 17a66577 authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: fixed/hacked plugin state serialization of Infinity value in trackball.maxDistance

parent 36026b30
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,14 @@ class PluginState {
}
async setSnapshot(snapshot: PluginState.Snapshot) {
// TODO
// JSON.stringify of Infinity => null ... is this a good place to fix it?
if (snapshot.canvas3d && snapshot.canvas3d.viewport && snapshot.canvas3d.viewport.trackball) {
if (snapshot.canvas3d.viewport.trackball.maxDistance === null) {
snapshot.canvas3d.viewport.trackball.maxDistance = Infinity;
}
}
await this.plugin.runTask(this.behaviorState.setSnapshot(snapshot.behaviour));
await this.plugin.runTask(this.dataState.setSnapshot(snapshot.data));
PluginCommands.Canvas3D.SetSettings.dispatch(this.plugin, { settings: snapshot.canvas3d.viewport || { } });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment