diff --git a/lib/features/auto-place/AutoPlaceUtil.js b/lib/features/auto-place/AutoPlaceUtil.js index 724a9eda..2718b531 100644 --- a/lib/features/auto-place/AutoPlaceUtil.js +++ b/lib/features/auto-place/AutoPlaceUtil.js @@ -158,14 +158,14 @@ function getTextAnnotationPosition(source, element) { var sourceTrbl = asTRBL(source); var position = { - x: sourceTrbl.right + 30 + element.width / 2, + x: sourceTrbl.right + element.width / 2, y: sourceTrbl.top - 50 - element.height / 2 }; var escapeDirection = { y: { margin: -30, - rowSize: 30 + rowSize: 20 } }; @@ -183,14 +183,14 @@ function getDataElementPosition(source, element) { var sourceTrbl = asTRBL(source); var position = { - x: sourceTrbl.right + 50 + element.width / 2, + x: sourceTrbl.right - 10 + element.width / 2, y: sourceTrbl.bottom + 40 + element.width / 2 }; var escapeDirection = { x: { margin: 30, - rowSize: 80 + rowSize: 30 } }; diff --git a/test/spec/features/auto-place/AutoPlaceSpec.js b/test/spec/features/auto-place/AutoPlaceSpec.js index 671eea85..228ed917 100644 --- a/test/spec/features/auto-place/AutoPlaceSpec.js +++ b/test/spec/features/auto-place/AutoPlaceSpec.js @@ -104,6 +104,13 @@ describe('features/auto-place', function() { describe('should place bpmn:DataStoreReference', function() { it('bottom right of source', autoPlace({ + element: 'bpmn:DataStoreReference', + behind: 'TASK_2', + expectedBounds: { x: 369, y: 303, width: 50, height: 50 } + })); + + + it('next to existing', autoPlace({ element: 'bpmn:DataStoreReference', behind: 'TASK_3', expectedBounds: { x: 769, y: 247, width: 50, height: 50 } @@ -117,14 +124,14 @@ describe('features/auto-place', function() { it('top right of source', autoPlace({ element: 'bpmn:TextAnnotation', behind: 'TASK_2', - expectedBounds: { x: 409, y: 103, width: 100, height: 30 } + expectedBounds: { x: 379, y: 103, width: 100, height: 30 } })); it('above existing', autoPlace({ element: 'bpmn:TextAnnotation', behind: 'TASK_3', - expectedBounds: { x: 726, y: -4, width: 100, height: 30 } + expectedBounds: { x: 696, y: -4, width: 100, height: 30 } })); });