Browse Source

mol-plugin: fixed param source for transform update

David Sehnal 6 years ago
parent
commit
5cc9a7f4bd
2 changed files with 2 additions and 2 deletions
  1. 0 1
      src/mol-plugin/ui/plugin.tsx
  2. 2 1
      src/mol-plugin/ui/state/update-transform.tsx

+ 0 - 1
src/mol-plugin/ui/plugin.tsx

@@ -143,7 +143,6 @@ export class CurrentObject extends PluginComponent {
 
     render() {
         const current = this.current;
-
         const ref = current.ref;
         const cell = current.state.cells.get(ref)!;
         const parent: StateObjectCell | undefined = (cell.sourceRef && current.state.cells.get(cell.sourceRef)!) || void 0;

+ 2 - 1
src/mol-plugin/ui/state/update-transform.tsx

@@ -51,9 +51,10 @@ class UpdateTransformContol extends TransformContolBase<UpdateTransformContol.Pr
 
     static getDerivedStateFromProps(props: UpdateTransformContol.Props, state: UpdateTransformContol.ComponentState) {
         if (props.transform === state.transform) return null;
+        const cell = props.state.cells.get(props.transform.ref)!;
         const newState: Partial<UpdateTransformContol.ComponentState> = {
             transform: props.transform,
-            params: props.transform.params,
+            params: (cell.params && cell.params.values) || { },
             isInitial: true,
             error: void 0
         };