Fix for padding issue and some cleanup

This commit is contained in:
Knut Sveidqvist
2022-06-14 20:09:55 +02:00
parent 3b8d74f1f9
commit 69b7b0e029
4 changed files with 15 additions and 12 deletions

View File

@@ -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;