feat(canvas): 画布节点 - 恢复批量创作表与转换能力
This commit is contained in:
1 parent
dec5034578
commit
fca772a40c
36 files changed
+3341
-34
No files matched your search
@@ -4,6 +4,7 @@ import type { MouseEvent as ReactMouseEvent } from "react";
|
||||
import { canvasThemes } from "@/lib/canvas-theme";
|
||||
import { useThemeStore } from "@/stores/use-theme-store";
|
||||
import { STORYBOARD_HEADER_HEIGHT, STORYBOARD_ROW_HEIGHT, storyboardTableHeight } from "@/lib/canvas/canvas-storyboard-layout";
|
||||
import { batchReferenceHandleY } from "@/lib/canvas/canvas-batch-table";
|
||||
import type { CanvasConnection, CanvasNodeData, ConnectionHandle, Position } from "@/types/canvas";
|
||||
|
||||
export const ConnectionPath = React.memo(function ConnectionPath({
|
||||
@@ -174,6 +175,8 @@ export function activeConnectionPath(node: CanvasNodeData | undefined, handle: C
|
||||
* 垂直中心,避免同一个节点因鼠标落点产生漂移的“伪端口”。
|
||||
*/
|
||||
export function connectionHandleY(node: CanvasNodeData, handleId?: string, scrollTop = 0) {
|
||||
const batchY = batchReferenceHandleY(node, handleId);
|
||||
if (batchY !== undefined) return batchY;
|
||||
if (handleId === "storyboard:context") return node.position.y + node.height - (node.metadata?.storyboardComposerHeight || 104) / 2;
|
||||
if (!handleId?.startsWith("row:")) return node.position.y + node.height / 2;
|
||||
const rowId = handleId.slice(4);
|
||||
|
||||
Reference in new issue
Block a user