mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 14:59:53 +02:00
useMaxWidth should make height 100% too.
This commit is contained in:
@@ -778,12 +778,13 @@ const d3Attrs = function (d3Elem, attrs) {
|
|||||||
|
|
||||||
export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {
|
export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {
|
||||||
let attrs = new Map();
|
let attrs = new Map();
|
||||||
attrs.set('height', height);
|
|
||||||
if (useMaxWidth) {
|
if (useMaxWidth) {
|
||||||
attrs.set('width', '100%');
|
attrs.set('width', '100%');
|
||||||
|
attrs.set('height', '100%');
|
||||||
attrs.set('style', `max-width: ${width}px;`);
|
attrs.set('style', `max-width: ${width}px;`);
|
||||||
} else {
|
} else {
|
||||||
attrs.set('width', width);
|
attrs.set('width', width);
|
||||||
|
attrs.set('height', height);
|
||||||
}
|
}
|
||||||
return attrs;
|
return attrs;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user