()
| 498 | } |
| 499 | |
| 500 | private async queueRender(): Promise<void> { |
| 501 | this.renderChain = this.renderChain.then(async () => { |
| 502 | if (!this.presentation) return |
| 503 | this.emitRenderStart() |
| 504 | try { |
| 505 | const { scale, displayWidth, displayHeight } = this.getDisplayMetrics() |
| 506 | |
| 507 | this.cleanupScrollObserver?.() |
| 508 | this.cleanupScrollObserver = undefined |
| 509 | this.cleanupListMount?.() |
| 510 | this.cleanupListMount = undefined |
| 511 | this.ensureListSlideMountedFn = undefined |
| 512 | this.mountedSlides.clear() |
| 513 | for (const handle of this.slideHandles.values()) { |
| 514 | handle.dispose() |
| 515 | } |
| 516 | this.slideHandles.clear() |
| 517 | this.disposeAllCharts() |
| 518 | this.container.innerHTML = '' |
| 519 | this.container.style.position = 'relative' |
| 520 | |
| 521 | if (this.activeRenderMode === 'slide') { |
| 522 | this.renderSingleSlide(scale, displayWidth, displayHeight) |
| 523 | } else if (this.listOptions.windowed) { |
| 524 | await this.renderAllSlidesWindowed(scale, displayWidth, displayHeight) |
| 525 | } else { |
| 526 | await this.renderAllSlidesFull(scale, displayWidth, displayHeight) |
| 527 | } |
| 528 | |
| 529 | // Post-render width correction: appending slides may cause a scrollbar |
| 530 | // to appear on the page, narrowing the container. If the measured width |
| 531 | // changed, patch wrapper sizes and scale transforms in-place so content |
| 532 | // is not clipped by the (now narrower) container. |
| 533 | if (this.activeRenderMode !== 'slide') { |
| 534 | this.correctListMetricsIfNeeded() |
| 535 | } |
| 536 | |
| 537 | this.emitSlideChange(this.currentSlide) |
| 538 | } finally { |
| 539 | this.emitRenderComplete() |
| 540 | } |
| 541 | }) |
| 542 | return this.renderChain |
| 543 | } |
| 544 | |
| 545 | private handleContainerResize(): void { |
| 546 | if (!this.presentation) return |
no test coverage detected