mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 22:09:57 +02:00
Fix for padding issue and some cleanup
This commit is contained in:
@@ -931,6 +931,10 @@ export const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth)
|
||||
if (sWidth > width) {
|
||||
tx = (sWidth - width) / 2 + padding;
|
||||
width = sWidth + padding * 2;
|
||||
} else {
|
||||
if (Math.abs(sWidth - width) >= 2 * padding + 1) {
|
||||
width = width - padding;
|
||||
}
|
||||
}
|
||||
if (sHeight > height) {
|
||||
ty = (sHeight - height) / 2 + padding;
|
||||
|
Reference in New Issue
Block a user