Merge pull request #537 from Kienz/shadowBrush

Fix reset shadow of fabric brushes
This commit is contained in:
Juriy Zaytsev 2013-04-04 03:39:19 -07:00
commit 2c7205fec1
2 changed files with 5 additions and 15 deletions

View file

@ -65,11 +65,9 @@ fabric.BaseBrush = fabric.util.createClass({
setShadowStyles: function() {
var ctx = this.canvas.contextTop;
if (this.shadowBlur) {
ctx.shadowBlur = this.shadowBlur;
ctx.shadowColor = this.shadowColor || this.color;
ctx.shadowOffsetX = this.shadowOffsetX;
ctx.shadowOffsetY = this.shadowOffsetY;
}
ctx.shadowBlur = this.shadowBlur;
ctx.shadowColor = this.shadowColor || this.color;
ctx.shadowOffsetX = this.shadowOffsetX;
ctx.shadowOffsetY = this.shadowOffsetY;
}
});

View file

@ -29,15 +29,7 @@ fabric.CircleBrush = fabric.util.createClass( fabric.BaseBrush, /** @scope fabri
onMouseDown: function() {
this.points.length = 0;
this.canvas.clearContext(this.canvas.contextTop);
var ctx = this.canvas.contextTop;
if (this.shadowBlur) {
ctx.shadowBlur = this.shadowBlur;
ctx.shadowColor = this.shadowColor || this.color;
ctx.shadowOffsetX = this.shadowOffsetX;
ctx.shadowOffsetY = this.shadowOffsetY;
}
this.setShadowStyles();
},
/**