feat(modeling): integrate connection repair

This commit is contained in:
Nico Rehwaldt 2014-09-04 13:47:11 +02:00
parent 6f937cf2f3
commit d0644c953a
2 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,7 @@ Layouter.prototype.getConnectionWaypoints = function(connection) {
if (bo.$instanceOf('bpmn:SequenceFlow') || if (bo.$instanceOf('bpmn:SequenceFlow') ||
bo.$instanceOf('bpmn:MessageFlow')) { bo.$instanceOf('bpmn:MessageFlow')) {
var waypoints = ManhattanLayout.connectRectangles(source, target, start, end); var waypoints = ManhattanLayout.repairConnection(source, target, start, end, connection.waypoints);
if (waypoints) { if (waypoints) {
return waypoints; return waypoints;

View File

@ -38,20 +38,20 @@ describe('features/modeling - layout connection', function() {
// then // then
// expect cropped connection // expect cropped, repaired connection
expect(sequenceFlowConnection.waypoints).toDeepEqual([ expect(sequenceFlowConnection.waypoints).toDeepEqual([
{ original: { x: 553, y: 341 }, x: 578, y: 341 }, { original: { x: 553, y: 341 }, x: 578, y: 341 },
{ x: 655, y: 341 }, { x: 934, y: 341 },
{ x: 655, y: 436 }, { x: 934, y: 436 },
{ original: { x: 782, y: 436 }, x: 732, y: 436 } { original: { x: 832, y: 436 }, x: 832, y: 436 }
]); ]);
// expect cropped waypoints in di // expect cropped waypoints in di
expect(sequenceFlow.di.waypoint).toDeepEqual([ expect(sequenceFlow.di.waypoint).toDeepEqual([
{ $type: 'dc:Point', x: 578, y: 341 }, { $type: 'dc:Point', x: 578, y: 341 },
{ $type: 'dc:Point', x: 655, y: 341 }, { $type: 'dc:Point', x: 934, y: 341 },
{ $type: 'dc:Point', x: 655, y: 436 }, { $type: 'dc:Point', x: 934, y: 436 },
{ $type: 'dc:Point', x: 732, y: 436 } { $type: 'dc:Point', x: 832, y: 436 }
]); ]);
})); }));