diff --git a/frontend/src/app/components/block-overview-multi/block-overview-multi.component.ts b/frontend/src/app/components/block-overview-multi/block-overview-multi.component.ts index 32e6ffea3..526bcc040 100644 --- a/frontend/src/app/components/block-overview-multi/block-overview-multi.component.ts +++ b/frontend/src/app/components/block-overview-multi/block-overview-multi.component.ts @@ -74,6 +74,7 @@ export class BlockOverviewMultiComponent implements AfterViewInit, OnDestroy, On displayWidth: number; displayHeight: number; displayBlockWidth: number; + displayPadding: number; cssWidth: number; cssHeight: number; shaderProgram: WebGLProgram; @@ -388,16 +389,17 @@ export class BlockOverviewMultiComponent implements AfterViewInit, OnDestroy, On this.displayWidth = window.devicePixelRatio * this.cssWidth; this.displayHeight = window.devicePixelRatio * this.cssHeight; this.displayBlockWidth = window.devicePixelRatio * this.blockWidth; + this.displayPadding = window.devicePixelRatio * this.padding; this.canvas.nativeElement.width = this.displayWidth; this.canvas.nativeElement.height = this.displayHeight; if (this.gl) { this.gl.viewport(0, 0, this.displayWidth, this.displayHeight); } for (let i = 0; i < this.scenes.length; i++) { - const blocksPerRow = Math.floor((this.displayWidth + this.padding) / (this.displayBlockWidth + this.padding)); - const x = (i % blocksPerRow) * (this.displayBlockWidth + this.padding); + const blocksPerRow = Math.floor(this.displayWidth / (this.displayBlockWidth + (this.displayPadding * 2))); + const x = this.displayPadding + ((i % blocksPerRow) * (this.displayBlockWidth + (this.displayPadding * 2))); const row = Math.floor(i / blocksPerRow); - const y = this.displayHeight - ((row + 1) * this.displayBlockWidth); + const y = this.displayPadding + this.displayHeight - ((row + 1) * (this.displayBlockWidth + (this.displayPadding * 2))); if (this.scenes[i]) { this.scenes[i].resize({ x, y, width: this.displayBlockWidth, height: this.displayBlockWidth, animate: false }); this.start(); diff --git a/frontend/src/app/components/eight-blocks/eight-blocks.component.html b/frontend/src/app/components/eight-blocks/eight-blocks.component.html index 4717aee74..65b245cc1 100644 --- a/frontend/src/app/components/eight-blocks/eight-blocks.component.html +++ b/frontend/src/app/components/eight-blocks/eight-blocks.component.html @@ -3,6 +3,7 @@ #blockGraph [isLoading]="false" [numBlocks]="numBlocks" + [padding]="padding" [blockWidth]="blockWidth" [resolution]="resolution" [blockLimit]="stateService.blockVSize" diff --git a/frontend/src/app/components/eight-blocks/eight-blocks.component.ts b/frontend/src/app/components/eight-blocks/eight-blocks.component.ts index 7d19ccd0c..97f777e28 100644 --- a/frontend/src/app/components/eight-blocks/eight-blocks.component.ts +++ b/frontend/src/app/components/eight-blocks/eight-blocks.component.ts @@ -83,7 +83,7 @@ export class EightBlocksComponent implements OnInit, OnDestroy { width: '1080px', height: '1080px', maxWidth: '1080px', - padding: '', + margin: '', }; containerStyle = {}; resolution: number = 86; @@ -128,7 +128,7 @@ export class EightBlocksComponent implements OnInit, OnDestroy { width: this.blockWidth + 'px', height: this.blockWidth + 'px', maxWidth: this.blockWidth + 'px', - padding: (this.padding || 0) +'px 0px', + margin: (this.padding || 0) +'px ', }; this.cacheBlocksSubscription = this.cacheService.loadedBlocks$.subscribe((block: BlockExtended) => { diff --git a/frontend/src/app/components/eight-mempool/eight-mempool.component.ts b/frontend/src/app/components/eight-mempool/eight-mempool.component.ts index 046e13d75..f63972104 100644 --- a/frontend/src/app/components/eight-mempool/eight-mempool.component.ts +++ b/frontend/src/app/components/eight-mempool/eight-mempool.component.ts @@ -85,7 +85,7 @@ export class EightMempoolComponent implements OnInit, OnDestroy { width: '1080px', height: '1080px', maxWidth: '1080px', - padding: '', + margin: '', }; containerStyle = {}; resolution: number = 86; @@ -177,7 +177,7 @@ export class EightMempoolComponent implements OnInit, OnDestroy { width: this.blockWidth + 'px', height: this.blockWidth + 'px', maxWidth: this.blockWidth + 'px', - padding: (this.padding || 0) +'px 0px', + margin: (this.padding || 0) +'px ', }; this.websocketService.startTrackMempoolBlocks(this.blockIndices);