diff options
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/services')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts | 5 | ||||
-rw-r--r-- | sdc-workflow-designer-ui/src/app/services/workflow.service.ts | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts index 8d3d6552..0863fb5d 100644 --- a/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts +++ b/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts @@ -114,8 +114,9 @@ export class JsPlumbService { drop: event => {
const el = this.jsplumbInstance.getSelector(event.drag.el);
const type = el.attributes.nodeType.value;
- const left = event.e.clientX - event.drop.position[0];
- const top = event.e.clientY - event.drop.position[1];
+ // Mouse position minus drop canvas start position and minus icon half size
+ const left = event.e.clientX - 220 - (event.e.offsetX / 2);
+ const top = event.e.clientY - 70 - (event.e.offsetY / 2);
this.workflowService.addNode(type, type, top, left);
},
diff --git a/sdc-workflow-designer-ui/src/app/services/workflow.service.ts b/sdc-workflow-designer-ui/src/app/services/workflow.service.ts index a36b51ad..09e0e55e 100644 --- a/sdc-workflow-designer-ui/src/app/services/workflow.service.ts +++ b/sdc-workflow-designer-ui/src/app/services/workflow.service.ts @@ -34,6 +34,7 @@ export class WorkflowService { }
public save(): Observable<boolean> {
+ console.log(this.workflow);
return this.dataAccessService.catalogService.saveWorkflow(this.workflow);
}
|