()
| 543 | } |
| 544 | |
| 545 | private handleContainerResize(): void { |
| 546 | if (!this.presentation) return |
| 547 | if (this._fitMode !== 'contain') return |
| 548 | if (this.viewerOptions.width !== undefined) return |
| 549 | |
| 550 | const nextWidth = this.container.clientWidth || 0 |
| 551 | if (!nextWidth || nextWidth === this.lastMeasuredContainerWidth) return |
| 552 | this.lastMeasuredContainerWidth = nextWidth |
| 553 | |
| 554 | if (this.resizeRafId !== null) { |
| 555 | cancelAnimationFrame(this.resizeRafId) |
| 556 | } |
| 557 | this.resizeRafId = requestAnimationFrame(() => { |
| 558 | this.resizeRafId = null |
| 559 | void this.queueRender() |
| 560 | }) |
| 561 | } |
| 562 | |
| 563 | private setupAdaptiveResize(): void { |
| 564 | this.teardownAdaptiveResize() |
no test coverage detected