Skip to content

Commit

Permalink
fix(fabric.Object) Adding existence check for this.canvas on object s…
Browse files Browse the repository at this point in the history
…tacking mixins (#6207)
  • Loading branch information
paulconlin authored and asturur committed Mar 12, 2020
1 parent 44eef1d commit ea06560
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mixins/object_stacking.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
if (this.group) {
fabric.StaticCanvas.prototype.sendToBack.call(this.group, this);
}
else {
else if (this.canvas) {
this.canvas.sendToBack(this);
}
return this;
Expand All @@ -24,7 +24,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
if (this.group) {
fabric.StaticCanvas.prototype.bringToFront.call(this.group, this);
}
else {
else if (this.canvas) {
this.canvas.bringToFront(this);
}
return this;
Expand All @@ -40,7 +40,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
if (this.group) {
fabric.StaticCanvas.prototype.sendBackwards.call(this.group, this, intersecting);
}
else {
else if (this.canvas) {
this.canvas.sendBackwards(this, intersecting);
}
return this;
Expand All @@ -56,7 +56,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
if (this.group) {
fabric.StaticCanvas.prototype.bringForward.call(this.group, this, intersecting);
}
else {
else if (this.canvas) {
this.canvas.bringForward(this, intersecting);
}
return this;
Expand All @@ -72,7 +72,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
if (this.group && this.group.type !== 'activeSelection') {
fabric.StaticCanvas.prototype.moveTo.call(this.group, this, index);
}
else {
else if (this.canvas) {
this.canvas.moveTo(this, index);
}
return this;
Expand Down

0 comments on commit ea06560

Please sign in to comment.