This commit is contained in:
Nico Rehwaldt 2015-07-30 14:17:48 +02:00
parent 7a1e7221e8
commit 6ad15de4d1
1 changed files with 7 additions and 6 deletions

View File

@ -281,7 +281,8 @@ BpmnSnapping.prototype.initSnap = function(event) {
var source = context.source,
connectedShapes,
shapeOrigin;
shapeOrigin,
shapeMid = mid(shape);
if (is(shape, 'bpmn:FlowNode')) {
@ -295,10 +296,10 @@ BpmnSnapping.prototype.initSnap = function(event) {
}
shapeOrigin = {
x: mid(shape).x - event.x,
y: mid(shape).y - event.y
};
shapeOrigin = shapeMid ? {
x: shapeMid.x - event.x,
y: shapeMid.y - event.y
} : { x: 0, y: 0 };
// add distance guides (better placement on diagram)
this.addDistanceSnapping(snapContext, shape, shapeOrigin, connectedShapes);
@ -314,7 +315,7 @@ BpmnSnapping.prototype.addDistanceSnapping = function(snapContext, shape, shapeO
snapContext.setSnapOrigin('distance', shapeOrigin);
var axisDistance = {
x: 80,
x: 50,
y: 50
};