MCPcopy
hub / github.com/impress/impress.js / computeWindowScale

Function computeWindowScale

js/impress.js:127–141  ·  view source on GitHub ↗
( config )

Source from the content-addressed store, hash-verified

125 // `computeWindowScale` counts the scale factor between window size and size
126 // defined for the presentation in the config.
127 var computeWindowScale = function( config ) {
128 var hScale = window.innerHeight / config.height,
129 wScale = window.innerWidth / config.width,
130 scale = hScale > wScale ? wScale : hScale;
131
132 if ( config.maxScale && scale > config.maxScale ) {
133 scale = config.maxScale;
134 }
135
136 if ( config.minScale && scale < config.minScale ) {
137 scale = config.minScale;
138 }
139
140 return scale;
141 };
142
143 // CHECK SUPPORT
144 var body = document.body;

Callers 2

initFunction · 0.70
gotoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected