tldraw/components/canvas/brush.tsx

24 lines
427 B
TypeScript
Raw Normal View History

2021-05-10 12:16:57 +00:00
import { useSelector } from "state"
import styled from "styles"
export default function Brush() {
const brush = useSelector(({ data }) => data.brush)
if (!brush) return null
return (
<BrushRect
x={brush.minX}
y={brush.minY}
width={brush.width}
height={brush.height}
className="brush"
/>
)
}
const BrushRect = styled("rect", {
fill: "$brushFill",
stroke: "$brushStroke",
})