Skip to content

Commit

Permalink
regression
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Apr 7, 2021
1 parent 05f421e commit 02f3360
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions dist/fabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -11105,8 +11105,8 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
* Get the context on which the erasing should occur
*/
getContext: function () {
//return this.canvas.getContext();
return this.canvas.contextTop;
return this.canvas.getContext();
// return this.canvas.contextTop;
},

/**
Expand Down Expand Up @@ -11239,8 +11239,8 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
*/
_finalizeAndAddPath: function () {

var ctx = this.getContext();
ctx.closePath();
//var ctx = this.getContext();
//ctx.closePath();
if (this.decimate) {
this._points = this.decimatePoints(this._points, this.decimate);
}
Expand All @@ -11256,7 +11256,7 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab

var path = this.createPath(pathData);
//this.canvas.clearContext(this.canvas.contextTop);
this.canvas.fire('before:path:created', { path: path });
// this.canvas.fire('before:path:created', { path: path });

if (this.canvas.backgroundImage && this.canvas.backgroundImage.erasable) {
this._addPathToObjectEraser(this.canvas.backgroundImage, path);
Expand All @@ -11267,12 +11267,12 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
this._addPathToObjectEraser(obj, path);
}
});
this.canvas.requestRenderAll();
path.setCoords();
this._resetShadow();
this.canvas.renderAll();
//path.setCoords();
//this._resetShadow();

// fire event 'path' created
this.canvas.fire('path:created', { path: path });
// this.canvas.fire('path:created', { path: path });
}
});
})();
Expand Down
2 changes: 1 addition & 1 deletion dist/fabric.min.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/brushes/eraser_brush.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* Get the context on which the erasing should occur
*/
getContext: function () {
//return this.canvas.getContext();
return this.canvas.contextTop;
return this.canvas.getContext();
// return this.canvas.contextTop;
},

/**
Expand Down Expand Up @@ -146,8 +146,8 @@
*/
_finalizeAndAddPath: function () {

var ctx = this.getContext();
ctx.closePath();
//var ctx = this.getContext();
//ctx.closePath();
if (this.decimate) {
this._points = this.decimatePoints(this._points, this.decimate);
}
Expand All @@ -163,7 +163,7 @@

var path = this.createPath(pathData);
//this.canvas.clearContext(this.canvas.contextTop);
this.canvas.fire('before:path:created', { path: path });
// this.canvas.fire('before:path:created', { path: path });

if (this.canvas.backgroundImage && this.canvas.backgroundImage.erasable) {
this._addPathToObjectEraser(this.canvas.backgroundImage, path);
Expand All @@ -174,12 +174,12 @@
this._addPathToObjectEraser(obj, path);
}
});
this.canvas.requestRenderAll();
path.setCoords();
this._resetShadow();
this.canvas.renderAll();
//path.setCoords();
//this._resetShadow();

// fire event 'path' created
this.canvas.fire('path:created', { path: path });
// this.canvas.fire('path:created', { path: path });
}
});
})();

0 comments on commit 02f3360

Please sign in to comment.