summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-08-31 19:43:52 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-08-31 19:43:52 +0800
commite0597dc5b0a3718aa3b5991a65096c609d23dba2 (patch)
treef7b258112dfae0be3a51e5e6ea08189ce28f63fd /sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts
parent626d74e4c51aa47da5d5d643b5b7a04188b5552a (diff)
change component structure
separate bpmn elements from toolbar component, and add rest task and gateway elements. Issue-ID: SDC-266 Change-Id: I5aabe92b161a44bfc24290e93cd80b8d73dbe963 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts')
-rw-r--r--sdc-workflow-designer-ui/src/app/services/jsplumb.service.ts5
1 files changed, 3 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);
},