diff --git a/src/mol-data/int/impl/sorted-array.ts b/src/mol-data/int/impl/sorted-array.ts index 6fff1aa007c47f26cc99d19e8ed790e0e57c4398..0e6336af2f8fdbf2e56713dcce86481cdfd0ab61 100644 --- a/src/mol-data/int/impl/sorted-array.ts +++ b/src/mol-data/int/impl/sorted-array.ts @@ -32,7 +32,7 @@ export function hashCode(xs: Nums) { // hash of tuple (size, min, max, mid) const s = xs.length; if (!s) return 0; - if (s > 2) return hash4(s, xs[0], xs[s - 1], xs[s << 1]); + if (s > 2) return hash4(s, xs[0], xs[s - 1], xs[s >> 1]); return hash3(s, xs[0], xs[s - 1]); } diff --git a/src/mol-model/structure/structure/unit.ts b/src/mol-model/structure/structure/unit.ts index 725862657cb4b363b8b9379b3abc15edce5edf57..258141272e6fe52857ea23f20a2619b94e37fdf9 100644 --- a/src/mol-model/structure/structure/unit.ts +++ b/src/mol-model/structure/structure/unit.ts @@ -79,6 +79,13 @@ namespace Unit { } } + export namespace SymmetryGroup { + export function areInvariantElementsEqual(a: SymmetryGroup, b: SymmetryGroup) { + if (a.hashCode !== b.hashCode) return false; + return SortedArray.areEqual(a.elements, b.elements); + } + } + export function conformationId (unit: Unit) { return Unit.isAtomic(unit) ? unit.model.atomicConformation.id : unit.model.coarseConformation.id } diff --git a/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts b/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts index 365d51eb6536f9347ce6e2577cb0b79fe46be812..a73b2f2d313271bc73aa7f42e3b2ced8d0f2618e 100644 --- a/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts +++ b/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts @@ -35,7 +35,8 @@ export class StructureRepresentationInteractionBehavior extends PluginBehavior.W private createResVisualParams(s: Structure) { return StructureRepresentation3DHelpers.createParams(this.plugin, s, { - repr: BuiltInStructureRepresentations['ball-and-stick'] + repr: BuiltInStructureRepresentations['ball-and-stick'], + size: [BuiltInSizeThemes.uniform, () => ({ value: 0.85 } )] }); } @@ -43,7 +44,7 @@ export class StructureRepresentationInteractionBehavior extends PluginBehavior.W return StructureRepresentation3DHelpers.createParams(this.plugin, s, { repr: BuiltInStructureRepresentations['ball-and-stick'], color: [BuiltInColorThemes.uniform, () => ({ value: ColorNames.gray })], - size: [BuiltInSizeThemes.uniform, () => ({ value: 0.2} )] + size: [BuiltInSizeThemes.uniform, () => ({ value: 0.33 } )] }); } diff --git a/src/mol-repr/structure/units-visual.ts b/src/mol-repr/structure/units-visual.ts index f7ed2da1bb8afe8d62f4974e22e01e8e26a27bc1..074597241f3df1374ef19d1bb16e540299ef1f4a 100644 --- a/src/mol-repr/structure/units-visual.ts +++ b/src/mol-repr/structure/units-visual.ts @@ -88,7 +88,7 @@ export function UnitsVisual<G extends Geometry, P extends UnitsParams & Geometry if (!renderObject) { updateState.createNew = true - } else if (!currentStructureGroup || newStructureGroup.group.hashCode !== currentStructureGroup.group.hashCode) { + } else if (!currentStructureGroup || !Unit.SymmetryGroup.areInvariantElementsEqual(newStructureGroup.group, currentStructureGroup.group)) { updateState.createNew = true }