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 { ...@@ -87,7 +87,7 @@ interface Canvas3D {
const requestAnimationFrame = typeof window !== 'undefined' ? window.requestAnimationFrame : (f: (time: number) => void) => setImmediate(()=>f(Date.now())) const requestAnimationFrame = typeof window !== 'undefined' ? window.requestAnimationFrame : (f: (time: number) => void) => setImmediate(()=>f(Date.now()))
namespace Canvas3D { 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 interface ClickEvent { current: Representation.Loci, buttons: ButtonsType, modifiers: ModifiersKeys }
export function fromCanvas(canvas: HTMLCanvasElement, props: Partial<Canvas3DProps> = {}) { export function fromCanvas(canvas: HTMLCanvasElement, props: Partial<Canvas3DProps> = {}) {
......
...@@ -59,7 +59,7 @@ export class Canvas3dInteractionHelper { ...@@ -59,7 +59,7 @@ export class Canvas3dInteractionHelper {
const loci = this.getLoci(this.id); const loci = this.getLoci(this.id);
if (!Representation.Loci.areEqual(this.prevLoci, loci)) { 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; this.prevLoci = loci;
} }
} }
...@@ -75,9 +75,8 @@ export class Canvas3dInteractionHelper { ...@@ -75,9 +75,8 @@ export class Canvas3dInteractionHelper {
leave() { leave() {
this.inside = false; this.inside = false;
if (this.prevLoci.loci !== EmptyLoci) { if (this.prevLoci.loci !== EmptyLoci) {
const prev = this.prevLoci;
this.prevLoci = Representation.Loci.Empty; 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 { ...@@ -99,7 +98,7 @@ export class Canvas3dInteractionHelper {
modify(modifiers: ModifiersKeys) { modify(modifiers: ModifiersKeys) {
if (this.prevLoci.loci === EmptyLoci || ModifiersKeys.areEqual(modifiers, this.modifiers)) return; if (this.prevLoci.loci === EmptyLoci || ModifiersKeys.areEqual(modifiers, this.modifiers)) return;
this.modifiers = modifiers; 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() { dispose() {
......
...@@ -73,7 +73,7 @@ export class PluginContext { ...@@ -73,7 +73,7 @@ export class PluginContext {
isUpdating: this.ev.behavior<boolean>(false) isUpdating: this.ev.behavior<boolean>(false)
}, },
canvas3d: { 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 }) click: this.ev.behavior<Canvas3D.ClickEvent>({ current: Representation.Loci.Empty, modifiers: ModifiersKeys.None, buttons: 0 })
}, },
labels: { labels: {
......
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