From 54c3c23e363e99772be4f0db30b177c2bffc1b39 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sat, 10 May 2014 11:18:13 +0200 Subject: fix bug in retrieval or background images while in pdf mode --- js/reveal.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/reveal.js b/js/reveal.js index da43738..8c0889b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -451,8 +451,8 @@ var slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight ); // Dimensions of the PDF pages - var pageWidth = Math.ceil( slideSize.width * ( 1 + config.margin ) ), - pageHeight = Math.ceil( slideSize.height * ( 1 + config.margin ) ); + var pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ), + pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) ); // Dimensions of slides within the pages var slideWidth = slideSize.width, @@ -2756,7 +2756,14 @@ // inside of the slides if( isPrintingPDF() ) { var slide = getSlide( x, y ); - return slide ? slide.querySelector( '.slide-background' ) : undefined; + if( slide ) { + var background = slide.querySelector( '.slide-background' ); + if( background && background.parentNode === slide ) { + return background; + } + } + + return undefined; } var horizontalBackground = document.querySelectorAll( '.backgrounds>.slide-background' )[ x ]; -- cgit v1.2.3