diff --git a/src/mol-repr/structure/representation/ball-and-stick.ts b/src/mol-repr/structure/representation/ball-and-stick.ts index 570973184bcc913afbb9a7848f32b9bbbee8078f..7a081a09adbc10584de25d271965d8973d916cc4 100644 --- a/src/mol-repr/structure/representation/ball-and-stick.ts +++ b/src/mol-repr/structure/representation/ball-and-stick.ts @@ -29,7 +29,7 @@ export const BallAndStickParams = { ...IntraUnitLinkParams, ...InterUnitLinkParams, unitKinds: PD.MultiSelect<UnitKind>(['atomic'], UnitKindOptions), - sizeFactor: PD.Numeric(0.3, { min: 0.01, max: 10, step: 0.01 }), + sizeFactor: PD.Numeric(0.2, { min: 0.01, max: 10, step: 0.01 }), sizeAspectRatio: PD.Numeric(2/3, { min: 0.01, max: 3, step: 0.01 }), visuals: PD.MultiSelect<BallAndStickVisualName>(['element-sphere', 'intra-link', 'inter-link'], BallAndStickVisualOptions), } @@ -50,6 +50,6 @@ export const BallAndStickRepresentationProvider: StructureRepresentationProvider getParams: getBallAndStickParams, defaultValues: PD.getDefaultValues(BallAndStickParams), defaultColorTheme: 'element-symbol', - defaultSizeTheme: 'uniform', + defaultSizeTheme: 'physical', isApplicable: (structure: Structure) => structure.elementCount > 0 } \ No newline at end of file diff --git a/src/mol-repr/structure/visual/inter-unit-link-cylinder.ts b/src/mol-repr/structure/visual/inter-unit-link-cylinder.ts index 2ca73dfc0918fdb67249bfa25ffa56c2ce443488..fdfdfbde2c44946d0680c14c0765eace0512d0c1 100644 --- a/src/mol-repr/structure/visual/inter-unit-link-cylinder.ts +++ b/src/mol-repr/structure/visual/inter-unit-link-cylinder.ts @@ -43,7 +43,11 @@ function createInterUnitLinkCylinderMesh(ctx: VisualContext, structure: Structur const b = bonds[edgeIndex] location.unit = b.unitA location.element = b.unitA.elements[b.indexA] - return theme.size.size(location) * sizeFactor * sizeAspectRatio + const sizeA = theme.size.size(location) + location.unit = b.unitB + location.element = b.unitB.elements[b.indexB] + const sizeB = theme.size.size(location) + return Math.min(sizeA, sizeB) * sizeFactor * sizeAspectRatio }, ignore: ignoreHydrogens ? (edgeIndex: number) => { const b = bonds[edgeIndex] diff --git a/src/mol-repr/structure/visual/intra-unit-link-cylinder.ts b/src/mol-repr/structure/visual/intra-unit-link-cylinder.ts index 611ea6858715247d2c1e5e05b15d56c4427cdf07..fb8b8ec43cad9af71024f18a2a4775d477ab01bd 100644 --- a/src/mol-repr/structure/visual/intra-unit-link-cylinder.ts +++ b/src/mol-repr/structure/visual/intra-unit-link-cylinder.ts @@ -63,7 +63,10 @@ function createIntraUnitLinkCylinderMesh(ctx: VisualContext, unit: Unit, structu flags: (edgeIndex: number) => BitFlags.create(_flags[edgeIndex]), radius: (edgeIndex: number) => { location.element = elements[a[edgeIndex]] - return theme.size.size(location) * sizeFactor * sizeAspectRatio + const sizeA = theme.size.size(location) + location.element = elements[b[edgeIndex]] + const sizeB = theme.size.size(location) + return Math.min(sizeA, sizeB) * sizeFactor * sizeAspectRatio }, ignore: ignoreHydrogens ? (edgeIndex: number) => { return isHydrogen(unit, elements[a[edgeIndex]]) || isHydrogen(unit, elements[b[edgeIndex]])