Bläddra i källkod

mol-plugin: do not update focus theme if not set

David Sehnal 4 år sedan
förälder
incheckning
6c8ae32ff9
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      src/mol-plugin-state/builder/structure/representation-preset.ts

+ 2 - 0
src/mol-plugin-state/builder/structure/representation-preset.ts

@@ -55,6 +55,8 @@ export namespace StructureRepresentationPresetProvider {
     }
 
     export function updateFocusRepr<T extends ColorTheme.BuiltIn>(plugin: PluginContext, structure: Structure, themeName: T | undefined, themeParams: ColorTheme.BuiltInParams<T> | undefined) {
+        if (!themeName && !themeParams) return;
+
         return plugin.state.updateBehavior(StructureFocusRepresentation, p => {
             const c = createStructureColorThemeParams(plugin, structure, 'ball-and-stick', themeName, themeParams);
             p.surroundingsParams.colorTheme = c;