Only show block audit highlighting when audit enabled

This commit is contained in:
Mononaut
2023-01-26 18:57:32 -06:00
parent 714700d8f1
commit 3c3814910a
4 changed files with 40 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On
@Input() disableSpinner = false;
@Input() mirrorTxid: string | void;
@Input() unavailable: boolean = false;
@Input() auditHighlighting: boolean = false;
@Output() txClickEvent = new EventEmitter<TransactionStripped>();
@Output() txHoverEvent = new EventEmitter<string>();
@Output() readyEvent = new EventEmitter();
@@ -70,6 +71,9 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On
if (changes.mirrorTxid) {
this.setMirror(this.mirrorTxid);
}
if (changes.auditHighlighting) {
this.setHighlightingEnabled(this.auditHighlighting);
}
}
ngOnDestroy(): void {
@@ -195,7 +199,7 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On
this.start();
} else {
this.scene = new BlockScene({ width: this.displayWidth, height: this.displayHeight, resolution: this.resolution,
blockLimit: this.blockLimit, orientation: this.orientation, flip: this.flip, vertexArray: this.vertexArray });
blockLimit: this.blockLimit, orientation: this.orientation, flip: this.flip, vertexArray: this.vertexArray, highlighting: this.auditHighlighting });
this.start();
}
}
@@ -396,6 +400,13 @@ export class BlockOverviewGraphComponent implements AfterViewInit, OnDestroy, On
}
}
setHighlightingEnabled(enabled: boolean): void {
if (this.scene) {
this.scene.setHighlighting(enabled);
this.start();
}
}
onTxClick(cssX: number, cssY: number) {
const x = cssX * window.devicePixelRatio;
const y = cssY * window.devicePixelRatio;