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

removed unused HighlightEvent.prev

parent 34b1eee8
No related branches found
No related tags found
No related merge requests found
......@@ -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> = {}) {
......
......@@ -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() {
......
......@@ -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: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment