浏览代码

allow partial reprParams in StructureRepresentation3DHelpers.createParams

Alexander Rose 5 年之前
父节点
当前提交
fac183c2ee
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/mol-plugin/state/transforms/representation.ts

+ 3 - 2
src/mol-plugin/state/transforms/representation.ts

@@ -68,9 +68,10 @@ namespace StructureRepresentation3DHelpers {
         const repr = params.repr
             ? params.repr instanceof Array ? params.repr[0] : params.repr
             : ctx.structureRepresentation.registry.default.provider;
+        const reprDefaultParams = PD.getDefaultValues(repr.getParams(themeCtx, structure));
         const reprParams = params.repr instanceof Array
-            ? params.repr[1](repr as R, themeCtx, structure)
-            : PD.getDefaultValues(repr.getParams(themeCtx, structure));
+            ? { ...reprDefaultParams, ...params.repr[1](repr as R, themeCtx, structure) }
+            : reprDefaultParams;
 
         const color = params.color
             ? params.color instanceof Array ? params.color[0] : params.color