tldraw/components/canvas/brush.tsx
2021-06-21 22:35:28 +01:00

23 lines
435 B
TypeScript

import { useSelector } from 'state'
import styled from 'styles'
export default function Brush(): JSX.Element {
const brush = useSelector(({ data }) => data.brush)
if (!brush) return null
return (
<BrushRect
x={brush.minX}
y={brush.minY}
width={brush.width}
height={brush.height}
/>
)
}
const BrushRect = styled('rect', {
fill: '$brushFill',
stroke: '$brushStroke',
zStrokeWidth: 1,
})