From 6ec259a0e71174651bae95d4628138bf6fd68742 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sun, 15 Mar 2026 16:19:35 -0400 Subject: refactor: packages/ --- packages/excalidraw/scene/comparisons.ts | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 packages/excalidraw/scene/comparisons.ts (limited to 'packages/excalidraw/scene/comparisons.ts') diff --git a/packages/excalidraw/scene/comparisons.ts b/packages/excalidraw/scene/comparisons.ts new file mode 100644 index 0000000..9af3e66 --- /dev/null +++ b/packages/excalidraw/scene/comparisons.ts @@ -0,0 +1,44 @@ +import type { ElementOrToolType } from "../types"; + +export const hasBackground = (type: ElementOrToolType) => + type === "rectangle" || + type === "iframe" || + type === "embeddable" || + type === "ellipse" || + type === "diamond" || + type === "line" || + type === "freedraw"; + +export const hasStrokeColor = (type: ElementOrToolType) => + type !== "image" && type !== "frame" && type !== "magicframe"; + +export const hasStrokeWidth = (type: ElementOrToolType) => + type === "rectangle" || + type === "iframe" || + type === "embeddable" || + type === "ellipse" || + type === "diamond" || + type === "freedraw" || + type === "arrow" || + type === "line"; + +export const hasStrokeStyle = (type: ElementOrToolType) => + type === "rectangle" || + type === "iframe" || + type === "embeddable" || + type === "ellipse" || + type === "diamond" || + type === "arrow" || + type === "line"; + +export const canChangeRoundness = (type: ElementOrToolType) => + type === "rectangle" || + type === "iframe" || + type === "embeddable" || + type === "line" || + type === "diamond" || + type === "image"; + +export const toolIsArrow = (type: ElementOrToolType) => type === "arrow"; + +export const canHaveArrowheads = (type: ElementOrToolType) => type === "arrow"; -- cgit v1.2.3