Skip to content
Snippets Groups Projects
Commit 9152c4e8 authored by Alexander Rose's avatar Alexander Rose
Browse files

fix complex-visual colorTheme.structure assignment

parent 5ae2dfcf
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
......@@ -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
......
......@@ -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)
......
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