()
| 481 | } |
| 482 | |
| 483 | private getDisplayMetrics(): { scale: number; displayWidth: number; displayHeight: number } { |
| 484 | if (!this.presentation) { |
| 485 | return { scale: 1, displayWidth: 0, displayHeight: 0 } |
| 486 | } |
| 487 | const fitWidth = this.viewerOptions.width ?? (this.container.clientWidth || 960) |
| 488 | if (this._fitMode === 'contain' && this.viewerOptions.width === undefined) { |
| 489 | this.lastMeasuredContainerWidth = fitWidth |
| 490 | } |
| 491 | const fitScale = this._fitMode === 'contain' ? fitWidth / this.presentation.width : 1 |
| 492 | const scale = fitScale * this.zoomFactor |
| 493 | return { |
| 494 | scale, |
| 495 | displayWidth: this.presentation.width * scale, |
| 496 | displayHeight: this.presentation.height * scale, |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | private async queueRender(): Promise<void> { |
| 501 | this.renderChain = this.renderChain.then(async () => { |
no outgoing calls
no test coverage detected