Merge pull request #12418 from MoonE/fix-icon-tinting
Fix icon tinting with pixelRatio < 1
This commit is contained in:
@@ -239,7 +239,7 @@ class IconImage extends EventTarget {
|
|||||||
// a solid color image with the shape of the icon.
|
// a solid color image with the shape of the icon.
|
||||||
if (ctx.globalCompositeOperation === 'multiply' || this.isTainted_()) {
|
if (ctx.globalCompositeOperation === 'multiply' || this.isTainted_()) {
|
||||||
ctx.fillStyle = asString(this.color_);
|
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.globalCompositeOperation = 'destination-in';
|
||||||
ctx.drawImage(this.image_, 0, 0);
|
ctx.drawImage(this.image_, 0, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user