diff --git a/lib/util/LabelUtil.js b/lib/util/LabelUtil.js index f4927609..a7a1ade3 100644 --- a/lib/util/LabelUtil.js +++ b/lib/util/LabelUtil.js @@ -9,6 +9,8 @@ var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = { height: 20 }; +var FLOW_LABEL_INDENT = module.exports.FLOW_LABEL_INDENT = 15; + /** * Returns true if the given semantic has an external label @@ -49,9 +51,9 @@ function getFlowLabelPosition(waypoints) { y = position.y; if ( Math.abs(angle) < Math.PI / 2 ) { - y += DEFAULT_LABEL_SIZE.height / 2; + y -= FLOW_LABEL_INDENT; } else { - x += DEFAULT_LABEL_SIZE.width / 2; + x += FLOW_LABEL_INDENT; } return { x: x, y: y }; diff --git a/test/spec/util/LabelUtilSpec.js b/test/spec/util/LabelUtilSpec.js index 7832fb69..994291be 100644 --- a/test/spec/util/LabelUtilSpec.js +++ b/test/spec/util/LabelUtilSpec.js @@ -7,9 +7,6 @@ require('../../TestHelper'); var coreModule = require('../../../lib/core'), modelingModule = require('../../../lib/features/modeling'); -var ModelUtil = require('../../../lib/util/ModelUtil'), - LabelUtil = require('../../../lib/util/LabelUtil'); - describe('LabelUtil', function() { @@ -29,7 +26,7 @@ describe('LabelUtil', function() { // then expect(connection.label.x).to.be.equal(427); - expect(connection.label.y).to.be.equal(357); + expect(connection.label.y).to.be.equal(332); })); @@ -43,7 +40,7 @@ describe('LabelUtil', function() { var connection = modeling.connect(element1, element2); // then - expect(connection.label.x).to.be.equal(322); + expect(connection.label.x).to.be.equal(292); expect(connection.label.y).to.be.equal(219.5); }));