mirror of https://github.com/logseq/logseq
fix: disable rotate
parent
c093251f40
commit
e77fd12a22
|
@ -1,17 +1,14 @@
|
||||||
import * as React from 'react'
|
import { TLResizeCorner, TLResizeEdge } from '@tldraw/core'
|
||||||
import { TLResizeCorner, TLResizeEdge, TLRotateCorner } from '@tldraw/core'
|
|
||||||
import { observer } from 'mobx-react-lite'
|
import { observer } from 'mobx-react-lite'
|
||||||
import { EdgeHandle, CornerHandle, RotateHandle } from './handles'
|
|
||||||
import { SVGContainer } from '~components'
|
import { SVGContainer } from '~components'
|
||||||
import type { TLReactShape } from '~lib'
|
import type { TLReactShape } from '~lib'
|
||||||
import type { TLSelectionComponentProps } from '~types'
|
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>({
|
export const SelectionForeground = observer(function SelectionForeground<S extends TLReactShape>({
|
||||||
bounds,
|
bounds,
|
||||||
zoom,
|
zoom,
|
||||||
showResizeHandles,
|
showResizeHandles,
|
||||||
showRotateHandles,
|
|
||||||
shapes,
|
shapes,
|
||||||
}: TLSelectionComponentProps<S>) {
|
}: TLSelectionComponentProps<S>) {
|
||||||
const { width, height } = bounds
|
const { width, height } = bounds
|
||||||
|
@ -69,34 +66,6 @@ export const SelectionForeground = observer(function SelectionForeground<S exten
|
||||||
disabled={!canResize[0]}
|
disabled={!canResize[0]}
|
||||||
isHidden={!showResizeHandles}
|
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) && (
|
{canResize?.every(r => r) && (
|
||||||
<>
|
<>
|
||||||
<CornerHandle
|
<CornerHandle
|
||||||
|
|
Loading…
Reference in New Issue