Tldraw/packages/editor/src/lib/editor/tools/EraserShapeTool/EraserShapeTool.ts

16 wiersze
398 B
TypeScript

import { StateNode } from '../StateNode'
import { Erasing } from './children/Erasing'
import { Idle } from './children/Idle'
import { Pointing } from './children/Pointing'
export class EraserShapeTool extends StateNode {
static override id = 'eraser'
static initial = 'idle'
static children = () => [Idle, Pointing, Erasing]
onEnter = () => {
this.editor.setCursor({ type: 'cross' })
}
}