Set height of actor line height in sequenceDiagrams as discussed in issue #181

This commit is contained in:
knsv
2015-07-04 10:00:14 +02:00
parent ab1dd1e549
commit a8c8f9a472
9 changed files with 61 additions and 26 deletions

View File

@@ -287,7 +287,6 @@ module.exports.draw = function (text, id) {
var actors = sq.yy.getActors();
var actorKeys = sq.yy.getActorKeys();
var messages = sq.yy.getMessages();
module.exports.drawActors(diagram, actors, actorKeys, 0);
// The arrow head definition is attached to the svg once
@@ -372,6 +371,12 @@ module.exports.draw = function (text, id) {
var box = exports.bounds.getBounds();
// Adjust line height of actor lines now that the height of the diagram is known
log.debug('For line height fix Querying: #' + id + ' .actor-line')
var actorLines = d3.selectAll('#' + id + ' .actor-line');
actorLines.attr('y2',box.stopy)
var height = box.stopy - box.starty + 2*conf.diagramMarginY;
if(conf.mirrorActors){

View File

@@ -76,7 +76,7 @@ exports.drawLabel = function(elem , txtObject){
//return textElem;
};
var actorCnt = -1;
/**
* Draws an actor in the diagram with the attaced line
* @param center - The center of the the actor
@@ -87,7 +87,9 @@ exports.drawActor = function(elem, left, verticalPos, description,conf){
var center = left + (conf.width/2);
var g = elem.append("g");
if(verticalPos === 0) {
actorCnt++;
g.append("line")
.attr("id", 'actor'+actorCnt)
.attr("x1", center)
.attr("y1", 5)
.attr("x2", center)