Fixes #9789: Fix svg width calculation

This commit is contained in:
Juho Ylikorpi 2022-07-27 15:57:24 +03:00
parent a6be8dccf5
commit 9e2050d905

View File

@ -178,7 +178,7 @@ class CableTraceSVG:
""" """
Draw a set of parent objects. Draw a set of parent objects.
""" """
width = self.width / len(obj_list) width = self.width / len(obj_list) if len(obj_list) > 0 else self.width
for i, obj in enumerate(obj_list): for i, obj in enumerate(obj_list):
node = Node( node = Node(
position=(i * width, self.cursor), position=(i * width, self.cursor),
@ -197,7 +197,7 @@ class CableTraceSVG:
""" """
nodes = [] nodes = []
nodes_height = 0 nodes_height = 0
width = self.width / len(terminations) width = self.width / len(terminations) if len(terminations) > 0 else self.width
for i, term in enumerate(terminations): for i, term in enumerate(terminations):
node = Node( node = Node(