mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
One set of actionFinalize
This commit is contained in:
parent
b63cd86cd6
commit
64fa1c6948
3 changed files with 36 additions and 34 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