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