diff --git a/src/mol-canvas3d/canvas3d.ts b/src/mol-canvas3d/canvas3d.ts index db8512d8abcb07ed09580837cf711f493de61788..1a3aac0ad7f7b60eee121cdbba4a56b8fe04295e 100644 --- a/src/mol-canvas3d/canvas3d.ts +++ b/src/mol-canvas3d/canvas3d.ts @@ -87,7 +87,7 @@ interface Canvas3D { const requestAnimationFrame = typeof window !== 'undefined' ? window.requestAnimationFrame : (f: (time: number) => void) => setImmediate(()=>f(Date.now())) namespace Canvas3D { - export interface HighlightEvent { current: Representation.Loci, prev: Representation.Loci, modifiers?: ModifiersKeys } + export interface HighlightEvent { current: Representation.Loci, modifiers?: ModifiersKeys } export interface ClickEvent { current: Representation.Loci, buttons: ButtonsType, modifiers: ModifiersKeys } export function fromCanvas(canvas: HTMLCanvasElement, props: Partial<Canvas3DProps> = {}) { diff --git a/src/mol-canvas3d/helper/interaction-events.ts b/src/mol-canvas3d/helper/interaction-events.ts index ba28254f64e9afdb57e020c65f56096684e1ba67..2340dcf4a19a7fa0d3bb8a14132f34b8d88a1092 100644 --- a/src/mol-canvas3d/helper/interaction-events.ts +++ b/src/mol-canvas3d/helper/interaction-events.ts @@ -59,7 +59,7 @@ export class Canvas3dInteractionHelper { const loci = this.getLoci(this.id); if (!Representation.Loci.areEqual(this.prevLoci, loci)) { - this.events.highlight.next({ current: loci, prev: this.prevLoci, modifiers: this.modifiers }); + this.events.highlight.next({ current: loci, modifiers: this.modifiers }); this.prevLoci = loci; } } @@ -75,9 +75,8 @@ export class Canvas3dInteractionHelper { leave() { this.inside = false; if (this.prevLoci.loci !== EmptyLoci) { - const prev = this.prevLoci; this.prevLoci = Representation.Loci.Empty; - this.events.highlight.next({ current: this.prevLoci, prev }); + this.events.highlight.next({ current: this.prevLoci }); } } @@ -99,7 +98,7 @@ export class Canvas3dInteractionHelper { modify(modifiers: ModifiersKeys) { if (this.prevLoci.loci === EmptyLoci || ModifiersKeys.areEqual(modifiers, this.modifiers)) return; this.modifiers = modifiers; - this.events.highlight.next({ current: this.prevLoci, prev: this.prevLoci, modifiers: this.modifiers }); + this.events.highlight.next({ current: this.prevLoci, modifiers: this.modifiers }); } dispose() { diff --git a/src/mol-plugin/context.ts b/src/mol-plugin/context.ts index cb75bfa17818f1e7361c89ecd49dbeac700c62c8..5d696e47f10672bcf1457facff03b01aaf53ef14 100644 --- a/src/mol-plugin/context.ts +++ b/src/mol-plugin/context.ts @@ -73,7 +73,7 @@ export class PluginContext { isUpdating: this.ev.behavior<boolean>(false) }, canvas3d: { - highlight: this.ev.behavior<Canvas3D.HighlightEvent>({ current: Representation.Loci.Empty, prev: Representation.Loci.Empty }), + highlight: this.ev.behavior<Canvas3D.HighlightEvent>({ current: Representation.Loci.Empty }), click: this.ev.behavior<Canvas3D.ClickEvent>({ current: Representation.Loci.Empty, modifiers: ModifiersKeys.None, buttons: 0 }) }, labels: {