Skip to content

Commit

Permalink
fix pattern brush (#3112)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Jul 17, 2016
1 parent 6601af9 commit dde9eaa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/brushes/pattern_brush.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
* Creates path
*/
createPath: function(pathData) {
var path = this.callSuper('createPath', pathData);
var path = this.callSuper('createPath', pathData),
topLeft = path._getLeftTopCoords().scalarAdd(path.strokeWidth / 2);

path.stroke = new fabric.Pattern({
source: this.source || this.getPatternSrcFunction()
source: this.source || this.getPatternSrcFunction(),
offsetX: -topLeft.x,
offsetY: -topLeft.y
});
return path;
}
Expand Down

0 comments on commit dde9eaa

Please sign in to comment.