reorder scale condition; if calculated scale is exactly 1 don't apply any scale styles
This commit is contained in:
parent
54e44ef4e2
commit
8c76f85e34
13
js/reveal.js
13
js/reveal.js
|
@ -1469,9 +1469,6 @@
|
||||||
dom.slides.style.width = size.width + 'px';
|
dom.slides.style.width = size.width + 'px';
|
||||||
dom.slides.style.height = size.height + 'px';
|
dom.slides.style.height = size.height + 'px';
|
||||||
|
|
||||||
// No point in calculating scale if the only possible
|
|
||||||
// result is 1
|
|
||||||
if( scale !== -1 || config.minScale !== 1 || config.maxScale !== 1 ) {
|
|
||||||
// Determine scale of content to fit within available space
|
// Determine scale of content to fit within available space
|
||||||
scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height );
|
scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height );
|
||||||
|
|
||||||
|
@ -1479,6 +1476,16 @@
|
||||||
scale = Math.max( scale, config.minScale );
|
scale = Math.max( scale, config.minScale );
|
||||||
scale = Math.min( scale, config.maxScale );
|
scale = Math.min( scale, config.maxScale );
|
||||||
|
|
||||||
|
// Don't apply any scaling styles if scale is 1
|
||||||
|
if( scale === 1 ) {
|
||||||
|
dom.slides.style.zoom = '';
|
||||||
|
dom.slides.style.left = '';
|
||||||
|
dom.slides.style.top = '';
|
||||||
|
dom.slides.style.bottom = '';
|
||||||
|
dom.slides.style.right = '';
|
||||||
|
transformElement( dom.slides, '' );
|
||||||
|
}
|
||||||
|
else {
|
||||||
// Prefer zooming in desktop Chrome so that content remains crisp
|
// Prefer zooming in desktop Chrome so that content remains crisp
|
||||||
if( !isMobileDevice && /chrome/i.test( navigator.userAgent ) && typeof dom.slides.style.zoom !== 'undefined' ) {
|
if( !isMobileDevice && /chrome/i.test( navigator.userAgent ) && typeof dom.slides.style.zoom !== 'undefined' ) {
|
||||||
dom.slides.style.zoom = scale;
|
dom.slides.style.zoom = scale;
|
||||||
|
|
Loading…
Reference in New Issue