mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 15:31:04 +02:00
@@ -1,11 +1,6 @@
|
|||||||
import { average } from "@excalidraw/math";
|
import { average } from "@excalidraw/math";
|
||||||
import { isImageElement } from "@excalidraw/element";
|
|
||||||
|
|
||||||
import type {
|
import type { FontFamilyValues, FontString } from "@excalidraw/element/types";
|
||||||
ExcalidrawBindableElement,
|
|
||||||
FontFamilyValues,
|
|
||||||
FontString,
|
|
||||||
} from "@excalidraw/element/types";
|
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ActiveTool,
|
ActiveTool,
|
||||||
@@ -567,9 +562,6 @@ export const isTransparent = (color: string) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isAlwaysInsideBinding = (element: ExcalidrawBindableElement) =>
|
|
||||||
isImageElement(element);
|
|
||||||
|
|
||||||
export type ResolvablePromise<T> = Promise<T> & {
|
export type ResolvablePromise<T> = Promise<T> & {
|
||||||
resolve: [T] extends [undefined]
|
resolve: [T] extends [undefined]
|
||||||
? (value?: MaybePromise<Awaited<T>>) => void
|
? (value?: MaybePromise<Awaited<T>>) => void
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
import {
|
import { KEYS, arrayToMap, invariant, isTransparent } from "@excalidraw/common";
|
||||||
KEYS,
|
|
||||||
arrayToMap,
|
|
||||||
invariant,
|
|
||||||
isAlwaysInsideBinding,
|
|
||||||
isTransparent,
|
|
||||||
} from "@excalidraw/common";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
lineSegment,
|
lineSegment,
|
||||||
@@ -53,6 +47,7 @@ import {
|
|||||||
isBindableElement,
|
isBindableElement,
|
||||||
isBoundToContainer,
|
isBoundToContainer,
|
||||||
isElbowArrow,
|
isElbowArrow,
|
||||||
|
isImageElement,
|
||||||
isRectanguloidElement,
|
isRectanguloidElement,
|
||||||
isTextElement,
|
isTextElement,
|
||||||
} from "./typeChecks";
|
} from "./typeChecks";
|
||||||
@@ -107,6 +102,9 @@ export const getFixedBindingDistance = (
|
|||||||
element: ExcalidrawBindableElement,
|
element: ExcalidrawBindableElement,
|
||||||
): number => FIXED_BINDING_DISTANCE + element.strokeWidth / 2;
|
): number => FIXED_BINDING_DISTANCE + element.strokeWidth / 2;
|
||||||
|
|
||||||
|
export const isAlwaysInsideBinding = (element: ExcalidrawBindableElement) =>
|
||||||
|
isImageElement(element);
|
||||||
|
|
||||||
export const shouldEnableBindingForPointerEvent = (
|
export const shouldEnableBindingForPointerEvent = (
|
||||||
event: React.PointerEvent<HTMLElement>,
|
event: React.PointerEvent<HTMLElement>,
|
||||||
) => {
|
) => {
|
||||||
|
Reference in New Issue
Block a user