@erase2d/fabric
Version:
Fabric.js erase2d bindings
27 lines • 1.16 kB
TypeScript
import { Canvas, FabricObject } from 'fabric';
/**
* Prepare the pattern for the erasing brush
* This pattern will be drawn on the top context after clipping the main context,
* achieving a visual effect of erasing only erasable objects.
*
* This is designed to support erasing a collection with both erasable and non-erasable objects while maintaining object stacking.\
* Iterates over collections to allow nested selective erasing.\
* Prepares objects before rendering the pattern brush.\
* If brush is **NOT** inverted render all non-erasable objects.\
* If brush is inverted render all objects, erasable objects without their eraser.
* This will render the erased parts as if they were not erased in the first place, achieving an undo effect.
*
* Caveat:
* Does not support erasing effects of shadows
*
*/
export declare function draw(ctx: CanvasRenderingContext2D, { inverted, opacity }: {
inverted: boolean;
opacity: number;
}, { canvas, objects, background, overlay, }: {
canvas: Canvas;
objects?: FabricObject[];
background?: FabricObject;
overlay?: FabricObject;
}): void;
//# sourceMappingURL=ErasingEffect.d.ts.map