resolves #1490 consistent SVG height and width between diagrams

This commit is contained in:
Guillaume Grossetie
2020-08-23 15:45:23 +02:00
parent 459e07834c
commit 184fcab0b7
15 changed files with 242 additions and 192 deletions

View File

@@ -5,7 +5,7 @@ import { parser } from './parser/sequenceDiagram';
import common from '../common/common';
import sequenceDb from './sequenceDb';
import * as configApi from '../../config';
import utils, { assignWithDepth } from '../../utils';
import utils, { assignWithDepth, configureSvgSize } from '../../utils';
parser.yy = sequenceDb;
@@ -706,15 +706,8 @@ export const draw = function(text, id) {
.attr('y', -25);
}
if (conf.useMaxWidth) {
diagram.attr('height', '100%');
diagram.attr('width', '100%');
diagram.attr('style', 'max-width:' + width + 'px;');
// diagram.attr('style', 'max-width:100%;');
} else {
diagram.attr('height', height);
diagram.attr('width', width);
}
configureSvgSize(diagram, height, width, conf.useMaxWidth);
const extraVertForTitle = title ? 40 : 0;
diagram.attr(
'viewBox',