You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

brush.tsx 427B

1234567891011121314151617181920212223
  1. import { useSelector } from "state"
  2. import styled from "styles"
  3. export default function Brush() {
  4. const brush = useSelector(({ data }) => data.brush)
  5. if (!brush) return null
  6. return (
  7. <BrushRect
  8. x={brush.minX}
  9. y={brush.minY}
  10. width={brush.width}
  11. height={brush.height}
  12. className="brush"
  13. />
  14. )
  15. }
  16. const BrushRect = styled("rect", {
  17. fill: "$brushFill",
  18. stroke: "$brushStroke",
  19. })