Skip to content

Commit 55aafc0

Browse files
committed
bugfix
Fixed bug generated by trying to create vertical lines of zero height
1 parent 7327c8f commit 55aafc0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

phy2html.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ def tree_recursion(tree, min_col: int, max_col: int, min_row: int, max_row: int,
164164
"""
165165
horizontal_connections.sort()
166166
for i in range(1, len(horizontal_connections)):
167-
new_line = VLine(horizontal_connections[i-1]+1, horizontal_connections[i]-horizontal_connections[i-1],
168-
min_col+col_span)
169-
vlines.append(new_line)
170-
if label_branches:
171-
new_line.label = "vline" + str(len(vlines))
167+
if horizontal_connections[i] != horizontal_connections[i-1]: # skip for lines of zero height
168+
new_line = VLine(horizontal_connections[i-1]+1, horizontal_connections[i]-horizontal_connections[i-1],
169+
min_col+col_span)
170+
vlines.append(new_line)
171+
if label_branches:
172+
new_line.label = "vline" + str(len(vlines))
172173

173174
else: # this is a tip node
174175
"""

0 commit comments

Comments
 (0)