MCPcopy Index your code
hub / github.com/simstudioai/sim / handleContainerResize

Method handleContainerResize

apps/sim/lib/pptx-renderer/core/viewer.ts:545–561  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()

Callers 1

setupAdaptiveResizeMethod · 0.95

Calls 1

queueRenderMethod · 0.95

Tested by

no test coverage detected