Skip to content

Commit

Permalink
fix dataurl and improve docs for move forward/backward (#4229)
Browse files Browse the repository at this point in the history
* fix dataurl and docs
* fixed paths
  • Loading branch information
asturur authored Aug 18, 2017
1 parent 16f5baa commit a15d480
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/brushes/pencil_brush.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@
strokeLineCap: this.strokeLineCap,
strokeLineJoin: this.strokeLineJoin,
strokeDashArray: this.strokeDashArray,
originX: 'center',
originY: 'center'
});

if (path.originX !== 'left' || path.originY !== 'top') {
var position = new fabric.Point({ x: path.left, y: path.top });
position = path.translateToGivenOrigin(position, 'left', 'top', path.originX, path.originY);
}
if (this.shadow) {
this.shadow.affectStroke = true;
path.setShadow(this.shadow);
Expand Down
15 changes: 12 additions & 3 deletions src/static_canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,6 @@
*/
renderAll: function () {
var canvasToDrawOn = this.contextContainer;
if (this.isRendering) {
fabric.util.cancelAnimFrame(this.isRendering);
}
this.renderCanvas(canvasToDrawOn, this._objects);
return this;
},
Expand Down Expand Up @@ -882,6 +879,10 @@
* @chainable
*/
renderCanvas: function(ctx, objects) {
if (this.isRendering) {
fabric.util.cancelAnimFrame(this.isRendering);
this.isRendering = 0;
}
this.calcViewportBoundaries();
this.clearContext(ctx);
this.fire('before:render');
Expand Down Expand Up @@ -1497,6 +1498,10 @@

/**
* Moves an object or a selection down in stack of drawn objects
* An optional paramter, intersecting allowes to move the object in behind
* the first intersecting object. Where intersection is calculated with
* bounding box. If no intersection is found, there will not be change in the
* stack.
* @param {fabric.Object} object Object to send
* @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object
* @return {fabric.Canvas} thisArg
Expand Down Expand Up @@ -1566,6 +1571,10 @@

/**
* Moves an object or a selection up in stack of drawn objects
* An optional paramter, intersecting allowes to move the object in front
* of the first intersecting object. Where intersection is calculated with
* bounding box. If no intersection is found, there will not be change in the
* stack.
* @param {fabric.Object} object Object to send
* @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object
* @return {fabric.Canvas} thisArg
Expand Down

0 comments on commit a15d480

Please sign in to comment.