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.

rotate-handle.tsx 735B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import useHandleEvents from 'hooks/useBoundsEvents'
  2. import styled from 'styles'
  3. import { Bounds } from 'types'
  4. export default function Rotate({
  5. bounds,
  6. size,
  7. }: {
  8. bounds: Bounds
  9. size: number
  10. }): JSX.Element {
  11. const events = useHandleEvents('rotate')
  12. return (
  13. <g cursor="grab" {...events}>
  14. <circle
  15. cx={bounds.width / 2}
  16. cy={size * -2}
  17. r={size * 2}
  18. fill="transparent"
  19. stroke="none"
  20. />
  21. <StyledRotateHandle
  22. cx={bounds.width / 2}
  23. cy={size * -2}
  24. r={size / 2}
  25. pointerEvents="none"
  26. />
  27. </g>
  28. )
  29. }
  30. const StyledRotateHandle = styled('circle', {
  31. stroke: '$bounds',
  32. fill: '$canvas',
  33. zStrokeWidth: 1.5,
  34. cursor: 'grab',
  35. })