fix for #1088 when presentation is not scaled

This commit is contained in:
Hakim El Hattab 2015-01-19 08:41:26 +01:00
parent e0aba9f5ae
commit 9e14b261ea

View File

@ -1446,6 +1446,7 @@
var size = getComputedSlideSize();
var slidePadding = 20; // TODO Dig this out of DOM
var zTransform = z !== 0 ? 'translateZ(-'+ z +'px)' : '';
// Layout the contents of the slides
layoutSlideContents( config.width, config.height, slidePadding );
@ -1467,13 +1468,13 @@
dom.slides.style.top = '';
dom.slides.style.bottom = '';
dom.slides.style.right = '';
transformElement( dom.slides, '' );
transformElement( dom.slides, zTransform );
}
else {
// Prefer zooming in desktop Chrome so that content remains crisp
if( !isMobileDevice && /chrome/i.test( navigator.userAgent ) && typeof dom.slides.style.zoom !== 'undefined' ) {
dom.slides.style.zoom = scale;
transformElement( dom.slides, 'translateZ(-'+ z +'px)' );
transformElement( dom.slides, zTransform );
}
// Apply scale transform as a fallback
else {
@ -1481,7 +1482,7 @@
dom.slides.style.top = '50%';
dom.slides.style.bottom = 'auto';
dom.slides.style.right = 'auto';
transformElement( dom.slides, 'translate(-50%, -50%) scale('+ scale +')' + ' translateZ(-'+ z +'px)' );
transformElement( dom.slides, 'translate(-50%, -50%) scale('+ scale +') ' + zTransform );
}
}