fix: disable rotate

pull/6345/head
Peng Xiao 2022-08-06 23:27:47 +08:00
parent c093251f40
commit e77fd12a22
1 changed files with 2 additions and 33 deletions

View File

@ -1,17 +1,14 @@
import * as React from 'react'
import { TLResizeCorner, TLResizeEdge, TLRotateCorner } from '@tldraw/core'
import { TLResizeCorner, TLResizeEdge } from '@tldraw/core'
import { observer } from 'mobx-react-lite'
import { EdgeHandle, CornerHandle, RotateHandle } from './handles'
import { SVGContainer } from '~components'
import type { TLReactShape } from '~lib'
import type { TLSelectionComponentProps } from '~types'
import { RotateCornerHandle } from './handles/RotateCornerHandle.tsx'
import { CornerHandle, EdgeHandle } from './handles'
export const SelectionForeground = observer(function SelectionForeground<S extends TLReactShape>({
bounds,
zoom,
showResizeHandles,
showRotateHandles,
shapes,
}: TLSelectionComponentProps<S>) {
const { width, height } = bounds
@ -69,34 +66,6 @@ export const SelectionForeground = observer(function SelectionForeground<S exten
disabled={!canResize[0]}
isHidden={!showResizeHandles}
/>
<RotateCornerHandle
cx={0}
cy={0}
targetSize={targetSize}
corner={TLRotateCorner.TopLeft}
isHidden={!showRotateHandles}
/>
<RotateCornerHandle
cx={width + targetSize * 2}
cy={0}
targetSize={targetSize}
corner={TLRotateCorner.TopRight}
isHidden={!showRotateHandles}
/>
<RotateCornerHandle
cx={width + targetSize * 2}
cy={height + targetSize * 2}
targetSize={targetSize}
corner={TLRotateCorner.BottomRight}
isHidden={!showRotateHandles}
/>
<RotateCornerHandle
cx={0}
cy={height + targetSize * 2}
targetSize={targetSize}
corner={TLRotateCorner.BottomLeft}
isHidden={!showRotateHandles}
/>
{canResize?.every(r => r) && (
<>
<CornerHandle