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

Method getDisplayMetrics

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

Source from the content-addressed store, hash-verified

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

Callers 2

goToSlideMethod · 0.95
queueRenderMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected