From 9e14b261eafc007c257d64bab5a0df270067b59c Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 19 Jan 2015 08:41:26 +0100 Subject: [PATCH] fix for #1088 when presentation is not scaled --- js/reveal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 5805ee9..9634c6b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -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 ); } }