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

repr support for canvas3d.mark

parent a71e1585
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ interface Canvas3D { ...@@ -54,7 +54,7 @@ interface Canvas3D {
animate: () => void animate: () => void
pick: () => void pick: () => void
identify: (x: number, y: number) => Promise<PickingId | undefined> identify: (x: number, y: number) => Promise<PickingId | undefined>
mark: (loci: Loci, action: MarkerAction) => void mark: (loci: Loci, action: MarkerAction, repr?: Representation.Any) => void
getLoci: (pickingId: PickingId) => { loci: Loci, repr?: Representation.Any } getLoci: (pickingId: PickingId) => { loci: Loci, repr?: Representation.Any }
readonly didDraw: BehaviorSubject<now.Timestamp> readonly didDraw: BehaviorSubject<now.Timestamp>
...@@ -133,10 +133,12 @@ namespace Canvas3D { ...@@ -133,10 +133,12 @@ namespace Canvas3D {
return { loci, repr } return { loci, repr }
} }
function mark(loci: Loci, action: MarkerAction) { function mark(loci: Loci, action: MarkerAction, repr?: Representation.Any) {
let changed = false let changed = false
reprRenderObjects.forEach((roSet, repr) => { reprRenderObjects.forEach((_, _repr) => {
changed = repr.mark(loci, action) || changed if (!repr || repr === _repr) {
changed = _repr.mark(loci, action) || changed
}
}) })
if (changed) { if (changed) {
// console.log('changed') // console.log('changed')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment