diff --git a/lib/features/modeling/Layouter.js b/lib/features/modeling/Layouter.js index 0bbcf7e4..c730a18d 100644 --- a/lib/features/modeling/Layouter.js +++ b/lib/features/modeling/Layouter.js @@ -24,7 +24,7 @@ Layouter.prototype.getConnectionWaypoints = function(connection) { if (bo.$instanceOf('bpmn:SequenceFlow') || bo.$instanceOf('bpmn:MessageFlow')) { - var waypoints = ManhattanLayout.connectRectangles(source, target, start, end); + var waypoints = ManhattanLayout.repairConnection(source, target, start, end, connection.waypoints); if (waypoints) { return waypoints; diff --git a/test/spec/features/modeling/LayoutConnectionSpec.js b/test/spec/features/modeling/LayoutConnectionSpec.js index bf9e2ada..bb5a350b 100644 --- a/test/spec/features/modeling/LayoutConnectionSpec.js +++ b/test/spec/features/modeling/LayoutConnectionSpec.js @@ -38,20 +38,20 @@ describe('features/modeling - layout connection', function() { // then - // expect cropped connection + // expect cropped, repaired connection expect(sequenceFlowConnection.waypoints).toDeepEqual([ { original: { x: 553, y: 341 }, x: 578, y: 341 }, - { x: 655, y: 341 }, - { x: 655, y: 436 }, - { original: { x: 782, y: 436 }, x: 732, y: 436 } + { x: 934, y: 341 }, + { x: 934, y: 436 }, + { original: { x: 832, y: 436 }, x: 832, y: 436 } ]); // expect cropped waypoints in di expect(sequenceFlow.di.waypoint).toDeepEqual([ { $type: 'dc:Point', x: 578, y: 341 }, - { $type: 'dc:Point', x: 655, y: 341 }, - { $type: 'dc:Point', x: 655, y: 436 }, - { $type: 'dc:Point', x: 732, y: 436 } + { $type: 'dc:Point', x: 934, y: 341 }, + { $type: 'dc:Point', x: 934, y: 436 }, + { $type: 'dc:Point', x: 832, y: 436 } ]); }));