only use zoom to scale presentations up, fixes shifts in text layout
This commit is contained in:
parent
25da01ce41
commit
de3e1daab4
11
js/reveal.js
11
js/reveal.js
|
@ -1530,13 +1530,20 @@
|
||||||
transformSlides( { layout: '' } );
|
transformSlides( { layout: '' } );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Prefer zooming in desktop Chrome so that content remains crisp
|
// Use zoom to scale up in desktop Chrome so that content
|
||||||
if( !isMobileDevice && /chrome/i.test( navigator.userAgent ) && typeof dom.slides.style.zoom !== 'undefined' ) {
|
// remains crisp. We don't use zoom to scale down since that
|
||||||
|
// can lead to shifts in text layout/line breaks.
|
||||||
|
if( scale > 1 && !isMobileDevice && /chrome/i.test( navigator.userAgent ) && typeof dom.slides.style.zoom !== 'undefined' ) {
|
||||||
dom.slides.style.zoom = scale;
|
dom.slides.style.zoom = scale;
|
||||||
|
dom.slides.style.left = '';
|
||||||
|
dom.slides.style.top = '';
|
||||||
|
dom.slides.style.bottom = '';
|
||||||
|
dom.slides.style.right = '';
|
||||||
transformSlides( { layout: '' } );
|
transformSlides( { layout: '' } );
|
||||||
}
|
}
|
||||||
// Apply scale transform as a fallback
|
// Apply scale transform as a fallback
|
||||||
else {
|
else {
|
||||||
|
dom.slides.style.zoom = '';
|
||||||
dom.slides.style.left = '50%';
|
dom.slides.style.left = '50%';
|
||||||
dom.slides.style.top = '50%';
|
dom.slides.style.top = '50%';
|
||||||
dom.slides.style.bottom = 'auto';
|
dom.slides.style.bottom = 'auto';
|
||||||
|
|
Loading…
Reference in New Issue