mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
New elbow arrow is removed if too small
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
4ffe7fd991
commit
25a2ec4b49
4 changed files with 26 additions and 12 deletions
|
@ -3,10 +3,12 @@ import {
|
|||
viewportCoordsToSceneCoords,
|
||||
} from "@excalidraw/common";
|
||||
|
||||
import { pointsEqual } from "@excalidraw/math";
|
||||
|
||||
import type { AppState, Offsets, Zoom } from "@excalidraw/excalidraw/types";
|
||||
|
||||
import { getCommonBounds, getElementBounds } from "./bounds";
|
||||
import { isFreeDrawElement, isLinearElement } from "./typeChecks";
|
||||
import { isElbowArrow, isFreeDrawElement, isLinearElement } from "./typeChecks";
|
||||
|
||||
import type { ElementsMap, ExcalidrawElement } from "./types";
|
||||
|
||||
|
@ -16,6 +18,12 @@ import type { ElementsMap, ExcalidrawElement } from "./types";
|
|||
export const isInvisiblySmallElement = (
|
||||
element: ExcalidrawElement,
|
||||
): boolean => {
|
||||
if (isElbowArrow(element)) {
|
||||
return (
|
||||
element.points.length < 2 ||
|
||||
pointsEqual(element.points[0], element.points[element.points.length - 1])
|
||||
);
|
||||
}
|
||||
if (isLinearElement(element) || isFreeDrawElement(element)) {
|
||||
return element.points.length < 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue