feat(canvas): 自由画布 - 增强空白起点、外观设置与节点连接体验 (#356)

This commit is contained in:
vv-get-ti authored and GitHub committed 2026-08-31 06:49:43 +08:00
1 parent 955e4964e9
commit 9e718fcf4a
22 files changed
+925 -113

No files matched your search

@@ -0,0 +1,13 @@
import type { Position } from "@/types/canvas";
type NodeSize = {
width: number;
height: number;
};
export function connectedNodeCenterFromEdgeDrop(dropPosition: Position, nodeSize: NodeSize, handleType: "source" | "target"): Position {
return {
x: dropPosition.x + (handleType === "source" ? nodeSize.width / 2 : -nodeSize.width / 2),
y: dropPosition.y,
};
}