-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Lines 197 to 203 in fe6fdc3
| export class Laser extends Brush { | |
| pathCreated = (e: PathEvent): void => { | |
| setTimeout(() => { | |
| this.baseCanvas.remove(e.path); | |
| this.baseCanvas.requestRenderAll(); | |
| }, 1000); | |
| }; |
Lines 163 to 173 in fe6fdc3
| export class Eraser extends Brush { | |
| pathCreated = (e: PathEvent): void => { | |
| const path = fabric.util.object.clone(e.path); | |
| this.baseCanvas.remove(e.path); | |
| const objects = this.baseCanvas | |
| .getObjects() | |
| .filter((object) => object.intersectsWithObject(path)); | |
| if (!objects.length) return; | |
| this.baseCanvas.remove(...objects); | |
| this.history.remove(objects); | |
| }; |
Is it because Eraser path operations are done immediately after creating the stroke, so that the render happens slightly after the invocation of the function? If so, is this guaranteed by fabric (I doubt it) or just lucky?
(Replacing Eraser with Pen in this question also raises a valid question, but the answer to that question is that you don't do anything worthy of re-render.)
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested