emoji devicePixelRatio vs backingStorePixelRatio fixes #2419 (#2420)

Thx for your work.
This commit is contained in:
Peter Coles
2019-06-18 16:46:49 -04:00
committed by Veeck
parent 8c5b557c8b
commit 74e1feb4b8

View File

@@ -12,10 +12,16 @@ define(['Modernizr', 'createElement', 'test/canvastext'], function(Modernizr, cr
if (!Modernizr.canvastext) {
return false;
}
var pixelRatio = window.devicePixelRatio || 1;
var offset = 12 * pixelRatio;
var node = createElement('canvas');
var ctx = node.getContext('2d');
var backingStoreRatio =
ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
ctx.oBackingStorePixelRatio ||
ctx.backingStorePixelRatio ||
1;
var offset = 12 * backingStoreRatio;
ctx.fillStyle = '#f00';
ctx.textBaseline = 'top';
ctx.font = '32px Arial';