simpler retina detection fallback, close #2258

This commit is contained in:
Vladimir Agafonkin 2014-11-04 13:46:53 +02:00
parent f10512f836
commit 40376dc3be

View File

@ -23,14 +23,6 @@
gecko3d = 'MozPerspective' in doc.style, gecko3d = 'MozPerspective' in doc.style,
opera3d = 'OTransition' in doc.style; opera3d = 'OTransition' in doc.style;
var retina = 'devicePixelRatio' in window && window.devicePixelRatio > 1;
if (!retina && 'matchMedia' in window) {
var matches = window.matchMedia('(min-resolution:144dpi)');
retina = matches && matches.matches;
}
var touch = !window.L_NO_TOUCH && !phantomjs && (pointer || 'ontouchstart' in window || var touch = !window.L_NO_TOUCH && !phantomjs && (pointer || 'ontouchstart' in window ||
(window.DocumentTouch && document instanceof window.DocumentTouch)); (window.DocumentTouch && document instanceof window.DocumentTouch));
@ -59,7 +51,7 @@
msPointer: !!msPointer, msPointer: !!msPointer,
pointer: !!pointer, pointer: !!pointer,
retina: !!retina retina: (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1
}; };
}()); }());