From 3f1db1d71094c5ef6998854e53bec73f8450c514 Mon Sep 17 00:00:00 2001 From: pihart Date: Sat, 19 Jun 2021 15:16:37 -0700 Subject: [PATCH] Remove unnecessary path clone --- src/lib/tools.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/tools.ts b/src/lib/tools.ts index 4c74a0f0..29166ab9 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -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); };