Merge pull request #12418 from MoonE/fix-icon-tinting

Fix icon tinting with pixelRatio < 1
This commit is contained in:
MoonE
2021-06-21 18:16:06 +02:00
committed by GitHub

View File

@@ -239,7 +239,7 @@ class IconImage extends EventTarget {
// a solid color image with the shape of the icon.
if (ctx.globalCompositeOperation === 'multiply' || this.isTainted_()) {
ctx.fillStyle = asString(this.color_);
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillRect(0, 0, canvas.width / pixelRatio, canvas.height / pixelRatio);
ctx.globalCompositeOperation = 'destination-in';
ctx.drawImage(this.image_, 0, 0);