Skip to content

Commit

Permalink
fix(): assigning canvas for collections (#7934)
Browse files Browse the repository at this point in the history
Collections could be used as clip paths.
This PR fixes canvas assignment in such a case.
Because Group assigns canvas only if the property changed this should not affect performance.
  • Loading branch information
ShaMan123 authored May 14, 2022
1 parent 9377ee1 commit 23129ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shapes/object.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@
// needed to setup a couple of variables
// path canvas gets overridden with this one.
// TODO find a better solution?
clipPath.canvas = this.canvas;
clipPath._set('canvas', this.canvas);
clipPath.shouldCache();
clipPath._transformDone = true;
clipPath.renderCache({ forClipping: true });
Expand Down
2 changes: 1 addition & 1 deletion src/static_canvas.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@
this.drawControls(ctx);
}
if (path) {
path.canvas = this;
path._set('canvas', this);
// needed to setup a couple of variables
path.shouldCache();
path._transformDone = true;
Expand Down

0 comments on commit 23129ed

Please sign in to comment.