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

fixed StructureRepresentation.getLoci

parent 7be64c0d
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ import { RenderObject } from 'mol-gl/render-object'; ...@@ -11,7 +11,7 @@ import { RenderObject } from 'mol-gl/render-object';
import { Representation, RepresentationProps } from '..'; import { Representation, RepresentationProps } from '..';
import { ColorTheme } from '../../theme'; import { ColorTheme } from '../../theme';
import { PickingId } from '../../util/picking'; import { PickingId } from '../../util/picking';
import { Loci, EmptyLoci } from 'mol-model/loci'; import { Loci, EmptyLoci, isEmptyLoci } from 'mol-model/loci';
import { MarkerAction } from '../../util/marker-data'; import { MarkerAction } from '../../util/marker-data';
export interface UnitsRepresentation<P> { export interface UnitsRepresentation<P> {
...@@ -47,7 +47,7 @@ export function StructureRepresentation<P extends StructureProps>(reprCtor: () = ...@@ -47,7 +47,7 @@ export function StructureRepresentation<P extends StructureProps>(reprCtor: () =
function getLoci(pickingId: PickingId) { function getLoci(pickingId: PickingId) {
for (let i = 0, il = groupReprs.length; i < il; ++i) { for (let i = 0, il = groupReprs.length; i < il; ++i) {
const loc = groupReprs[i].repr.getLoci(pickingId) const loc = groupReprs[i].repr.getLoci(pickingId)
if (loc) return loc if (!isEmptyLoci(loc)) return loc
} }
return EmptyLoci return EmptyLoci
} }
......
...@@ -23,7 +23,7 @@ export function labelFirst(loci: Loci): string { ...@@ -23,7 +23,7 @@ export function labelFirst(loci: Loci): string {
if (e && e.indices[0] !== undefined) { if (e && e.indices[0] !== undefined) {
return elementLabel(Element.Location(e.unit, e.indices[0])) return elementLabel(Element.Location(e.unit, e.indices[0]))
} else { } else {
return 'Nothing' return 'Unknown'
} }
case 'link-loci': case 'link-loci':
const bond = loci.links[0] const bond = loci.links[0]
...@@ -32,10 +32,10 @@ export function labelFirst(loci: Loci): string { ...@@ -32,10 +32,10 @@ export function labelFirst(loci: Loci): string {
setElementLocation(elementLocB, bond.bUnit, bond.bIndex) setElementLocation(elementLocB, bond.bUnit, bond.bIndex)
return `${elementLabel(elementLocA)} - ${elementLabel(elementLocB)}` return `${elementLabel(elementLocA)} - ${elementLabel(elementLocB)}`
} else { } else {
return 'Nothing' return 'Unknown'
} }
case 'every-loci': case 'every-loci':
return 'Evertything' return 'Everything'
case 'empty-loci': case 'empty-loci':
return 'Nothing' return 'Nothing'
} }
......
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