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