tldraw/components/canvas/bounds/center-handle.tsx

37 lines
560 B
TypeScript
Raw Normal View History

2021-05-29 12:40:41 +00:00
import styled from 'styles'
import { Bounds } from 'types'
2021-05-29 12:40:41 +00:00
export default function CenterHandle({
bounds,
isLocked,
}: {
bounds: Bounds
isLocked: boolean
}) {
return (
<StyledBounds
2021-06-04 21:21:03 +00:00
x={-1}
y={-1}
width={bounds.width + 2}
height={bounds.height + 2}
pointerEvents="none"
2021-05-29 12:40:41 +00:00
isLocked={isLocked}
/>
)
}
2021-05-29 12:40:41 +00:00
const StyledBounds = styled('rect', {
fill: 'none',
stroke: '$bounds',
zStrokeWidth: 2,
2021-05-29 12:40:41 +00:00
variants: {
isLocked: {
true: {
zStrokeWidth: 1,
zDash: 2,
},
},
},
})