mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
Set height of actor line height in sequenceDiagrams as discussed in issue #181
This commit is contained in:
@@ -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){
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user