prefer transform scaling over zoom on hdpi displays

This commit is contained in:
Hakim El Hattab 2019-04-02 16:25:27 +02:00
parent 15dec96e73
commit 4c557a5959

View File

@ -2243,10 +2243,12 @@
transformSlides( { layout: '' } ); transformSlides( { layout: '' } );
} }
else { else {
// Prefer zoom for scaling up so that content remains crisp. // Zoom Scaling
// Don't use zoom to scale down since that can lead to shifts // Content remains crisp no matter how much we scale. Side
// in text layout/line breaks. // effects are minor differences in text layout and iframe
if( scale > 1 && features.zoom ) { // viewports changing size. A 200x200 iframe viewport in a
// 2x zoomed presentation ends up having a 400x400 viewport.
if( scale > 1 && features.zoom && window.devicePixelRatio < 2 ) {
dom.slides.style.zoom = scale; dom.slides.style.zoom = scale;
dom.slides.style.left = ''; dom.slides.style.left = '';
dom.slides.style.top = ''; dom.slides.style.top = '';
@ -2254,7 +2256,10 @@
dom.slides.style.right = ''; dom.slides.style.right = '';
transformSlides( { layout: '' } ); transformSlides( { layout: '' } );
} }
// Apply scale transform as a fallback // Transform Scaling
// Content layout remains the exact same when scaled up.
// Side effect is content becoming blurred, especially with
// high scale values on ldpi screens.
else { else {
dom.slides.style.zoom = ''; dom.slides.style.zoom = '';
dom.slides.style.left = '50%'; dom.slides.style.left = '50%';