multiblock padding
This commit is contained in:
		
							parent
							
								
									17db3d9004
								
							
						
					
					
						commit
						d2b918cf15
					
				| @ -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(); | ||||
|  | ||||
| @ -3,6 +3,7 @@ | ||||
|   #blockGraph | ||||
|   [isLoading]="false" | ||||
|   [numBlocks]="numBlocks" | ||||
|   [padding]="padding" | ||||
|   [blockWidth]="blockWidth" | ||||
|   [resolution]="resolution" | ||||
|   [blockLimit]="stateService.blockVSize" | ||||
|  | ||||
| @ -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) => { | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user