Skip to content

Commit 8fe3a31

Browse files
committed
Improved Box Size Calculation
1 parent f800daa commit 8fe3a31

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

ERDiagramXMLExportBundle/DependencyInjection/GraphMLWriter.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private function createAttributes($entry): string
155155
$attributesString = '';
156156

157157
if (!empty($fields)) {
158-
$this->actualBoxHeight = 40 + count($fields) * 30;
158+
$this->actualBoxHeight = 70 + count($fields) * 15;
159159

160160
foreach ($fields as $field) {
161161
foreach ($field as $fieldname => $fieldtype) {
@@ -171,7 +171,7 @@ private function createAttributes($entry): string
171171
$allowedTypes = substr($allowedTypes, 0, -3);
172172
$attributesString .= $fieldname . ': ' . $allowedTypes . PHP_EOL;
173173
}
174-
$this->actualBoxWidth = 120 + strlen($attributesString);
174+
$this->actualBoxWidth = 250 + strlen($fieldname);
175175
}
176176
}
177177
}
@@ -203,14 +203,6 @@ private function createAttributes($entry): string
203203
return $arrayToXml->dropXmlDeclaration()->prettify()->toXml();
204204
}
205205

206-
private function calculateBoxWidth($attributesString)
207-
{
208-
$newSize = 120 + strlen($attributesString);
209-
if ($newSize > $this->actualBoxWidth) {
210-
$this->actualBoxWidth = $newSize;
211-
}
212-
}
213-
214206
private function createEdge($source, $target, $relationType = '', $labelName)
215207
{
216208
if (strpos(strtolower($relationType), 'manytomany') !== false) {

0 commit comments

Comments
 (0)