mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-13 20:39:54 +02:00
fix: show bounding box for 3 or more linear point elements (#5554)
* fix: show bounding box for 3+ linear point elements * refactor * show bounding box for 3 points as well * fix dragging bounding box for linear elements * Increase margin/padding for linear elements * fix cursor and keep bounding box same but offset resize handles * introduce slight padding for selection border * better * add constant for spacing
This commit is contained in:
@@ -35,6 +35,7 @@ import { getShapeForElement } from "../renderer/renderElement";
|
||||
import { hasBoundTextElement, isImageElement } from "./typeChecks";
|
||||
import { isTextElement } from ".";
|
||||
import { isTransparent } from "../utils";
|
||||
import { shouldShowBoundingBox } from "./transformHandles";
|
||||
|
||||
const isElementDraggableFromInside = (
|
||||
element: NonDeletedExcalidrawElement,
|
||||
@@ -64,7 +65,10 @@ export const hitTest = (
|
||||
const threshold = 10 / appState.zoom.value;
|
||||
const point: Point = [x, y];
|
||||
|
||||
if (isElementSelected(appState, element) && !appState.selectedLinearElement) {
|
||||
if (
|
||||
isElementSelected(appState, element) &&
|
||||
shouldShowBoundingBox([element])
|
||||
) {
|
||||
return isPointHittingElementBoundingBox(element, point, threshold);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user