diff --git a/src/mol-repr/structure/units-representation.ts b/src/mol-repr/structure/units-representation.ts index b713ede00253e42f34151a19bd149f1157fd7e06..a286188a54102892db8a07baaf137b747c0683ce 100644 --- a/src/mol-repr/structure/units-representation.ts +++ b/src/mol-repr/structure/units-representation.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2018-2023 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> * @author David Sehnal <david.sehnal@gmail.com> @@ -232,12 +232,16 @@ export function UnitsRepresentation<P extends StructureParams>(label: string, ct if (substance !== undefined) visual.setSubstance(substance, webgl); if (clipping !== undefined) visual.setClipping(clipping); if (themeStrength !== undefined) visual.setThemeStrength(themeStrength); - if (transform !== undefined) visual.setTransform(transform); + if (transform !== undefined) { + if (transform !== _state.transform || !Mat4.areEqual(transform, _state.transform, EPSILON)) { + visual.setTransform(transform); + } + } if (unitTransforms !== undefined) { if (unitTransforms) { // console.log(group.hashCode, unitTransforms.getSymmetryGroupTransforms(group)) visual.setTransform(undefined, unitTransforms.getSymmetryGroupTransforms(group)); - } else { + } else if (unitTransforms !== _state.unitTransforms) { visual.setTransform(undefined, null); } }