feat(snapping): snap to source element

This ensures we snap to a source element if one is provided, i.e. during
shape.append.
This commit is contained in:
Nico Rehwaldt 2015-04-28 13:57:47 +02:00 committed by Ricardo Matias
parent b233ab957c
commit af9ce652e2
1 changed files with 8 additions and 0 deletions

View File

@ -193,6 +193,13 @@ BpmnSnapping.prototype.initSnap = function(event) {
y: docking.y - event.y
});
});
}
var source = context.source;
if (source) {
snapContext.addDefaultSnap('mid', mid(source));
}
};
@ -231,4 +238,5 @@ BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
snapPoints.add(c.id + '-docking', docking.original || docking);
}
});
};