1.0.4 • Published 1 year ago
erase2d v1.0.4
Erase2d
A simple erasing tool. Currently supports fabric out of the box.
Quick Start
npm i erase2d
import { EraserBrush } from 'erase2d';
const eraser = new EraserBrush(canvas);
eraser.width = 30;
canvas.freeDrawingBrush = eraser;
canvas.isDrawingMode = true;
// prevent from committing erasing to the tree
eraser.on('end', (e) => e.preventDefault())
Migrating from fabric@5
The logic has been reworked from the bottom.
Eraser
has been removed in favor of the leaner ClippingGroup
.
Replacing the type
in your data should be enough.
- type: 'eraser'
+ type: 'clipping'
Dev
npm start
Publish
npm version <type>
npm publish