tldraw/components/canvas/brush.tsx

24 lines
435 B
TypeScript
Raw Normal View History

2021-06-21 21:35:28 +00:00
import { useSelector } from 'state'
import styled from 'styles'
2021-05-10 12:16:57 +00:00
2021-06-21 21:35:28 +00:00
export default function Brush(): JSX.Element {
2021-05-10 12:16:57 +00:00
const brush = useSelector(({ data }) => data.brush)
if (!brush) return null
return (
<BrushRect
x={brush.minX}
y={brush.minY}
width={brush.width}
height={brush.height}
/>
)
}
2021-06-21 21:35:28 +00:00
const BrushRect = styled('rect', {
fill: '$brushFill',
stroke: '$brushStroke',
2021-05-27 18:51:25 +00:00
zStrokeWidth: 1,
2021-05-10 12:16:57 +00:00
})