import { BoxModel } from '@tldraw/tlschema' import { useRef } from 'react' import { useTransform } from '../../hooks/useTransform' import { toDomPrecision } from '../../primitives/utils' /** @public */ export interface TLBrushProps { userId?: string brush: BoxModel color?: string opacity?: number className?: string } /** @public @react */ export const DefaultBrush = ({ brush, color, opacity, className }: TLBrushProps) => { const rSvg = useRef(null) useTransform(rSvg, brush.x, brush.y) const w = toDomPrecision(Math.max(1, brush.w)) const h = toDomPrecision(Math.max(1, brush.h)) return ( ) }