fix: resize workflow canvas cause incorrect comment position

This commit is contained in:
hjlarry
2025-11-05 14:08:21 +08:00
parent ee3ded0fc2
commit 2f60288d86
5 changed files with 50 additions and 13 deletions

View File

@ -10,6 +10,13 @@ type PreviewRunningData = WorkflowRunningData & {
resultText?: string
}
type MousePosition = {
pageX: number
pageY: number
elementX: number
elementY: number
}
export type WorkflowSliceShape = {
workflowRunningData?: PreviewRunningData
setWorkflowRunningData: (workflowData: PreviewRunningData) => void
@ -21,9 +28,9 @@ export type WorkflowSliceShape = {
setBundleNodeSize: (bundleNodeSize: WorkflowSliceShape['bundleNodeSize']) => void
controlMode: 'pointer' | 'hand' | 'comment'
setControlMode: (controlMode: WorkflowSliceShape['controlMode']) => void
pendingComment: { x: number; y: number } | null
pendingComment: MousePosition | null
setPendingComment: (pendingComment: WorkflowSliceShape['pendingComment']) => void
mousePosition: { pageX: number; pageY: number; elementX: number; elementY: number }
mousePosition: MousePosition
setMousePosition: (mousePosition: WorkflowSliceShape['mousePosition']) => void
showConfirm?: { title: string; desc?: string; onConfirm: () => void }
setShowConfirm: (showConfirm: WorkflowSliceShape['showConfirm']) => void