This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

erase2d
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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.

https://github.com/ShaMan123/erase2d/blob/4c9657f8e2d6c20e7274f49a8f8e6d907f9e02e6/src/fabric/ClippingGroup.ts#L11

- type: 'eraser'
+ type: 'clipping'

Dev

npm start

Publish

npm version <type>
npm publish

Package Sidebar

Install

npm i erase2d

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

76.4 kB

Total Files

33

Last publish

Collaborators

  • shaman123