diff --git a/src/mol-geo/representation/structure/complex-representation.ts b/src/mol-geo/representation/structure/complex-representation.ts index 3e4b42416a1cd8eeca976a63039dd2fc6de31e01..a5e9f3aac9f59bfcf539d44b5c18db579f4c29e3 100644 --- a/src/mol-geo/representation/structure/complex-representation.ts +++ b/src/mol-geo/representation/structure/complex-representation.ts @@ -19,7 +19,6 @@ export function ComplexRepresentation<P extends StructureProps>(label: string, v function createOrUpdate(props: Partial<P> = {}, structure?: Structure) { _props = Object.assign({}, _props, props) - if (structure) _props.colorTheme.structure = structure return Task.create('Creating StructureRepresentation', async ctx => { if (!visual) visual = visualCtor() diff --git a/src/mol-geo/representation/structure/complex-visual.ts b/src/mol-geo/representation/structure/complex-visual.ts index b53af777d0746e80387a8eb4e8f6eb06fec9da04..179b9803d42cba49b812c808b8db67cd75ec5704 100644 --- a/src/mol-geo/representation/structure/complex-visual.ts +++ b/src/mol-geo/representation/structure/complex-visual.ts @@ -48,6 +48,7 @@ export function ComplexMeshVisual<P extends ComplexMeshProps>(builder: ComplexMe async function create(ctx: RuntimeContext, structure: Structure, props: Partial<P> = {}) { currentProps = Object.assign({}, defaultProps, props) + currentProps.colorTheme.structure = structure currentStructure = structure conformationHash = Structure.conformationHash(currentStructure) @@ -59,6 +60,7 @@ export function ComplexMeshVisual<P extends ComplexMeshProps>(builder: ComplexMe async function update(ctx: RuntimeContext, props: Partial<P>) { const newProps = Object.assign({}, currentProps, props) + newProps.colorTheme.structure = currentStructure if (!renderObject) return false diff --git a/src/mol-geo/representation/structure/representation/carbohydrate.ts b/src/mol-geo/representation/structure/representation/carbohydrate.ts index cf39824fbbf238a94bb81323883a2cac7764a654..e1f6d9da04a25ace5254abcbe8916945ba2c737b 100644 --- a/src/mol-geo/representation/structure/representation/carbohydrate.ts +++ b/src/mol-geo/representation/structure/representation/carbohydrate.ts @@ -15,13 +15,13 @@ import { CarbohydrateLinkVisual, DefaultCarbohydrateLinkProps } from '../visual/ import { SizeThemeProps } from 'mol-view/theme/size'; import { getQualityProps } from '../../util'; -export const DefaultCartoonProps = { +export const DefaultCarbohydrateProps = { ...DefaultCarbohydrateSymbolProps, ...DefaultCarbohydrateLinkProps, sizeTheme: { name: 'uniform', value: 1, factor: 1 } as SizeThemeProps, } -export type CarbohydrateProps = typeof DefaultCartoonProps +export type CarbohydrateProps = typeof DefaultCarbohydrateProps export type CarbohydrateRepresentation = StructureRepresentation<CarbohydrateProps> @@ -40,7 +40,7 @@ export function CarbohydrateRepresentation(): CarbohydrateRepresentation { }, createOrUpdate: (props: Partial<CarbohydrateProps> = {}, structure?: Structure) => { const qualityProps = getQualityProps(Object.assign({}, currentProps, props), structure) - currentProps = Object.assign({}, DefaultCartoonProps, currentProps, props, qualityProps) + currentProps = Object.assign({}, DefaultCarbohydrateProps, currentProps, props, qualityProps) return Task.create('Creating CarbohydrateRepresentation', async ctx => { await carbohydrateSymbolRepr.createOrUpdate(currentProps, structure).runInContext(ctx) await carbohydrateLinkRepr.createOrUpdate(currentProps, structure).runInContext(ctx)