enlarge shadow if retina scaling is active

This commit is contained in:
Andrea Bogazzi 2016-02-24 08:45:15 +01:00
parent 381f959f54
commit db068d59c9

View file

@ -1109,7 +1109,10 @@
var multX = (this.canvas && this.canvas.viewportTransform[0]) || 1,
multY = (this.canvas && this.canvas.viewportTransform[3]) || 1;
if (this._isRetinaScaling()) {
multX *= fabric.devicePixelRatio;
multY *= fabric.devicePixelRatio;
}
ctx.shadowColor = this.shadow.color;
ctx.shadowBlur = this.shadow.blur * (multX + multY) * (this.scaleX + this.scaleY) / 4;
ctx.shadowOffsetX = this.shadow.offsetX * multX * this.scaleX;