File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 17
17
LINE_HEIGHT = 20
18
18
FANOUT_HEIGHT = 35
19
19
FANOUT_LEG_HEIGHT = 15
20
- CABLE_HEIGHT = 4 * LINE_HEIGHT + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT
20
+ CABLE_HEIGHT = 5 * LINE_HEIGHT + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT
21
21
22
22
23
23
class Node (Hyperlink ):
@@ -405,7 +405,17 @@ def render(self):
405
405
end = far [0 ].top_center
406
406
text_offset = 0
407
407
408
- if len (near ) > 1 :
408
+ if len (near ) > 1 and len (far ) > 1 :
409
+ start_center = sum ([pos .bottom_center [0 ] for pos in near ]) / len (near )
410
+ end_center = sum ([pos .bottom_center [0 ] for pos in far ]) / len (far )
411
+ center_x = (start_center + end_center ) / 2
412
+
413
+ start = (center_x , start [1 ] + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT )
414
+ end = (center_x , end [1 ] - FANOUT_HEIGHT - FANOUT_LEG_HEIGHT )
415
+ text_offset -= (FANOUT_HEIGHT + FANOUT_LEG_HEIGHT )
416
+ self .draw_fanin (start , near , color )
417
+ self .draw_fanout (end , far , color )
418
+ elif len (near ) > 1 :
409
419
# Handle Fan-In - change start position to be directly below start
410
420
start = (end [0 ], start [1 ] + FANOUT_HEIGHT + FANOUT_LEG_HEIGHT )
411
421
self .draw_fanin (start , near , color )
You can’t perform that action at this time.
0 commit comments