fix for #1088 when presentation is not scaled

edit
Hakim El Hattab 2015-01-19 08:41:26 +01:00
parent e0aba9f5ae
commit 9e14b261ea
1 changed files with 4 additions and 3 deletions

View File

@ -1446,6 +1446,7 @@
var size = getComputedSlideSize(); var size = getComputedSlideSize();
var slidePadding = 20; // TODO Dig this out of DOM var slidePadding = 20; // TODO Dig this out of DOM
var zTransform = z !== 0 ? 'translateZ(-'+ z +'px)' : '';
// Layout the contents of the slides // Layout the contents of the slides
layoutSlideContents( config.width, config.height, slidePadding ); layoutSlideContents( config.width, config.height, slidePadding );
@ -1467,13 +1468,13 @@
dom.slides.style.top = ''; dom.slides.style.top = '';
dom.slides.style.bottom = ''; dom.slides.style.bottom = '';
dom.slides.style.right = ''; dom.slides.style.right = '';
transformElement( dom.slides, '' ); transformElement( dom.slides, zTransform );
} }
else { 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;
transformElement( dom.slides, 'translateZ(-'+ z +'px)' ); transformElement( dom.slides, zTransform );
} }
// Apply scale transform as a fallback // Apply scale transform as a fallback
else { else {
@ -1481,7 +1482,7 @@
dom.slides.style.top = '50%'; dom.slides.style.top = '50%';
dom.slides.style.bottom = 'auto'; dom.slides.style.bottom = 'auto';
dom.slides.style.right = '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 );
} }
} }