diff --git a/src/components/App.tsx b/src/components/App.tsx index 59c85a11..d806e58e 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -3060,7 +3060,7 @@ class App extends React.Component { setCursor(this.canvas, CURSOR_TYPE.MOVE); } } else if ( - shouldShowBoundingBox([element]) && + shouldShowBoundingBox([element], this.state) && isHittingElementBoundingBoxWithoutHittingElement( element, this.state, diff --git a/src/element/collision.ts b/src/element/collision.ts index 45d5d609..e47e5e55 100644 --- a/src/element/collision.ts +++ b/src/element/collision.ts @@ -67,7 +67,7 @@ export const hitTest = ( if ( isElementSelected(appState, element) && - shouldShowBoundingBox([element]) + shouldShowBoundingBox([element], appState) ) { return isPointHittingElementBoundingBox(element, point, threshold); } diff --git a/src/element/transformHandles.ts b/src/element/transformHandles.ts index baf7f279..5821b0b4 100644 --- a/src/element/transformHandles.ts +++ b/src/element/transformHandles.ts @@ -6,7 +6,7 @@ import { import { getElementAbsoluteCoords, Bounds } from "./bounds"; import { rotate } from "../math"; -import { Zoom } from "../types"; +import { AppState, Zoom } from "../types"; import { isTextElement } from "."; import { isLinearElement } from "./typeChecks"; import { DEFAULT_SPACING } from "../renderer/renderScene"; @@ -267,7 +267,11 @@ export const getTransformHandles = ( export const shouldShowBoundingBox = ( elements: NonDeletedExcalidrawElement[], + appState: AppState, ) => { + if (appState.editingLinearElement) { + return false; + } if (elements.length > 1) { return true; } diff --git a/src/renderer/renderScene.ts b/src/renderer/renderScene.ts index 361883b9..6e302c44 100644 --- a/src/renderer/renderScene.ts +++ b/src/renderer/renderScene.ts @@ -424,7 +424,10 @@ export const _renderScene = ({ !appState.editingLinearElement ) { const locallySelectedElements = getSelectedElements(elements, appState); - const showBoundingBox = shouldShowBoundingBox(locallySelectedElements); + const showBoundingBox = shouldShowBoundingBox( + locallySelectedElements, + appState, + ); const locallySelectedIds = locallySelectedElements.map( (element) => element.id,