Skip to content

Commit

Permalink
Remove unnecessary path clone
Browse files Browse the repository at this point in the history
  • Loading branch information
pihart authored and cjquines committed Jun 20, 2021
1 parent bb8521f commit 3f1db1d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,11 @@ export class Pen extends Brush {
}

export class Eraser extends Brush {
pathCreated = (e: PathEvent): void => {
const path = fabric.util.object.clone(e.path);
pathCreated = ({ path }: PathEvent): void => {
const objects = this.baseCanvas
.getObjects()
.filter((object) => object.intersectsWithObject(path));
this.baseCanvas.remove(e.path, ...objects);
this.baseCanvas.remove(path, ...objects);
this.history.remove(objects);
};

Expand Down

0 comments on commit 3f1db1d

Please sign in to comment.