Browse Source

increase node size per line to fit

AykutSarac 3 years ago
parent
commit
40f066d76a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/containers/LiveEditor/helpers.ts

+ 3 - 1
src/containers/LiveEditor/helpers.ts

@@ -32,6 +32,8 @@ export function getEdgeNodes(graph: any, isExpanded: boolean = true): any {
         .sort((a, b) => a - b);
         .sort((a, b) => a - b);
       const longestLine = lineLengths.reverse()[0];
       const longestLine = lineLengths.reverse()[0];
 
 
+      const height = (lines.length * 14 < 30 ? 30 : lines.length * 14) + 10;
+
       nodes.push({
       nodes.push({
         id: el.id,
         id: el.id,
         text: toString(el.text),
         text: toString(el.text),
@@ -39,7 +41,7 @@ export function getEdgeNodes(graph: any, isExpanded: boolean = true): any {
           isParent: el.parent,
           isParent: el.parent,
         },
         },
         width: isExpanded ? 35 + longestLine * 8 : 180,
         width: isExpanded ? 35 + longestLine * 8 : 180,
-        height: 30 + lines.length * 10,
+        height,
       });
       });
     } else {
     } else {
       edges.push(el);
       edges.push(el);