浏览代码

ensure pdf pages are never zero-height

Hakim El Hattab 11 年之前
父节点
当前提交
2ac0a55ccf
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 1 0
      css/print/pdf.css
  2. 1 1
      js/reveal.js

+ 1 - 0
css/print/pdf.css

@@ -119,6 +119,7 @@ ul, ol, div, p {
 	margin: 0 !important;
 	padding: 0 !important;
 	box-sizing: border-box !important;
+	min-height: 1px;
 
 	opacity: 1 !important;
 

+ 1 - 1
js/reveal.js

@@ -468,7 +468,7 @@
 					top = ( pageHeight - slideHeight ) / 2;
 
 				var contentHeight = getAbsoluteHeight( slide );
-				var numberOfPages = Math.ceil( contentHeight / pageHeight );
+				var numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 );
 
 				// Center slides vertically
 				if( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) {