multiblock padding
This commit is contained in:
		
							parent
							
								
									17db3d9004
								
							
						
					
					
						commit
						d2b918cf15
					
				| @ -74,6 +74,7 @@ export class BlockOverviewMultiComponent implements AfterViewInit, OnDestroy, On | |||||||
|   displayWidth: number; |   displayWidth: number; | ||||||
|   displayHeight: number; |   displayHeight: number; | ||||||
|   displayBlockWidth: number; |   displayBlockWidth: number; | ||||||
|  |   displayPadding: number; | ||||||
|   cssWidth: number; |   cssWidth: number; | ||||||
|   cssHeight: number; |   cssHeight: number; | ||||||
|   shaderProgram: WebGLProgram; |   shaderProgram: WebGLProgram; | ||||||
| @ -388,16 +389,17 @@ export class BlockOverviewMultiComponent implements AfterViewInit, OnDestroy, On | |||||||
|       this.displayWidth = window.devicePixelRatio * this.cssWidth; |       this.displayWidth = window.devicePixelRatio * this.cssWidth; | ||||||
|       this.displayHeight = window.devicePixelRatio * this.cssHeight; |       this.displayHeight = window.devicePixelRatio * this.cssHeight; | ||||||
|       this.displayBlockWidth = window.devicePixelRatio * this.blockWidth; |       this.displayBlockWidth = window.devicePixelRatio * this.blockWidth; | ||||||
|  |       this.displayPadding = window.devicePixelRatio * this.padding; | ||||||
|       this.canvas.nativeElement.width = this.displayWidth; |       this.canvas.nativeElement.width = this.displayWidth; | ||||||
|       this.canvas.nativeElement.height = this.displayHeight; |       this.canvas.nativeElement.height = this.displayHeight; | ||||||
|       if (this.gl) { |       if (this.gl) { | ||||||
|         this.gl.viewport(0, 0, this.displayWidth, this.displayHeight); |         this.gl.viewport(0, 0, this.displayWidth, this.displayHeight); | ||||||
|       } |       } | ||||||
|       for (let i = 0; i < this.scenes.length; i++) { |       for (let i = 0; i < this.scenes.length; i++) { | ||||||
|         const blocksPerRow = Math.floor((this.displayWidth + this.padding) / (this.displayBlockWidth + this.padding)); |         const blocksPerRow = Math.floor(this.displayWidth / (this.displayBlockWidth + (this.displayPadding * 2))); | ||||||
|         const x = (i % blocksPerRow) * (this.displayBlockWidth + this.padding); |         const x = this.displayPadding + ((i % blocksPerRow) * (this.displayBlockWidth + (this.displayPadding * 2))); | ||||||
|         const row = Math.floor(i / blocksPerRow); |         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]) { |         if (this.scenes[i]) { | ||||||
|           this.scenes[i].resize({ x, y, width: this.displayBlockWidth, height: this.displayBlockWidth, animate: false }); |           this.scenes[i].resize({ x, y, width: this.displayBlockWidth, height: this.displayBlockWidth, animate: false }); | ||||||
|           this.start(); |           this.start(); | ||||||
|  | |||||||
| @ -3,6 +3,7 @@ | |||||||
|   #blockGraph |   #blockGraph | ||||||
|   [isLoading]="false" |   [isLoading]="false" | ||||||
|   [numBlocks]="numBlocks" |   [numBlocks]="numBlocks" | ||||||
|  |   [padding]="padding" | ||||||
|   [blockWidth]="blockWidth" |   [blockWidth]="blockWidth" | ||||||
|   [resolution]="resolution" |   [resolution]="resolution" | ||||||
|   [blockLimit]="stateService.blockVSize" |   [blockLimit]="stateService.blockVSize" | ||||||
|  | |||||||
| @ -83,7 +83,7 @@ export class EightBlocksComponent implements OnInit, OnDestroy { | |||||||
|     width: '1080px', |     width: '1080px', | ||||||
|     height: '1080px', |     height: '1080px', | ||||||
|     maxWidth: '1080px', |     maxWidth: '1080px', | ||||||
|     padding: '', |     margin: '', | ||||||
|   }; |   }; | ||||||
|   containerStyle = {}; |   containerStyle = {}; | ||||||
|   resolution: number = 86; |   resolution: number = 86; | ||||||
| @ -128,7 +128,7 @@ export class EightBlocksComponent implements OnInit, OnDestroy { | |||||||
|         width: this.blockWidth + 'px', |         width: this.blockWidth + 'px', | ||||||
|         height: this.blockWidth + 'px', |         height: this.blockWidth + 'px', | ||||||
|         maxWidth: 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) => { |       this.cacheBlocksSubscription = this.cacheService.loadedBlocks$.subscribe((block: BlockExtended) => { | ||||||
|  | |||||||
| @ -85,7 +85,7 @@ export class EightMempoolComponent implements OnInit, OnDestroy { | |||||||
|     width: '1080px', |     width: '1080px', | ||||||
|     height: '1080px', |     height: '1080px', | ||||||
|     maxWidth: '1080px', |     maxWidth: '1080px', | ||||||
|     padding: '', |     margin: '', | ||||||
|   }; |   }; | ||||||
|   containerStyle = {}; |   containerStyle = {}; | ||||||
|   resolution: number = 86; |   resolution: number = 86; | ||||||
| @ -177,7 +177,7 @@ export class EightMempoolComponent implements OnInit, OnDestroy { | |||||||
|         width: this.blockWidth + 'px', |         width: this.blockWidth + 'px', | ||||||
|         height: this.blockWidth + 'px', |         height: this.blockWidth + 'px', | ||||||
|         maxWidth: this.blockWidth + 'px', |         maxWidth: this.blockWidth + 'px', | ||||||
|         padding: (this.padding || 0) +'px 0px', |         margin: (this.padding || 0) +'px ', | ||||||
|       }; |       }; | ||||||
| 
 | 
 | ||||||
|       this.websocketService.startTrackMempoolBlocks(this.blockIndices); |       this.websocketService.startTrackMempoolBlocks(this.blockIndices); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user