diff --git a/src/designer/elsa-workflows-designer/src/components/activities/flowchart/flowchart.tsx b/src/designer/elsa-workflows-designer/src/components/activities/flowchart/flowchart.tsx index 17add1cba..a4bbe473f 100644 --- a/src/designer/elsa-workflows-designer/src/components/activities/flowchart/flowchart.tsx +++ b/src/designer/elsa-workflows-designer/src/components/activities/flowchart/flowchart.tsx @@ -74,7 +74,8 @@ export class FlowchartComponent implements ContainerActivityComponent { // TODO: Figure out how to convert client coordinates to appropriate graph coordinates taking into account transformations. // See https://x6.antv.vision/en/docs/api/graph/coordinate for documentation. //const point = graph.coord.localToClientPoint(x, y); - const point: PointLike = {x, y}; + const pageToLocal = graph.pageToLocal(x, y); + const point: PointLike = pageToLocal; const sx = point.x; const sy = point.y; diff --git a/src/designer/elsa-workflows-designer/src/components/designer/workflow-definition-editor/workflow-definition-editor.tsx b/src/designer/elsa-workflows-designer/src/components/designer/workflow-definition-editor/workflow-definition-editor.tsx index 5f2cecc40..a7633149a 100644 --- a/src/designer/elsa-workflows-designer/src/components/designer/workflow-definition-editor/workflow-definition-editor.tsx +++ b/src/designer/elsa-workflows-designer/src/components/designer/workflow-definition-editor/workflow-definition-editor.tsx @@ -271,8 +271,8 @@ export class WorkflowDefinitionEditor { await this.canvas.addActivity({ descriptor: activityDescriptor, id: newName, - x: e.offsetX, - y: e.offsetY + x: e.pageX, + y: e.pageY }); };