Simpler feature check

This commit is contained in:
Andreas Hocevar
2020-03-22 20:05:27 +01:00
parent b9bfe45d86
commit 30ac91c4ae

View File

@@ -37,7 +37,7 @@ export const MAC = ua.indexOf('macintosh') !== -1;
* @type {number}
* @api
*/
export const DEVICE_PIXEL_RATIO = (typeof self !== 'undefined' ? self.devicePixelRatio : window.devicePixelRatio) || 1;
export const DEVICE_PIXEL_RATIO = typeof devicePixelRatio !== 'undefined' ? devicePixelRatio : 1;
/**
* The execution context is a worker with OffscreenCanvas available.