From 9e2050d905e87a14b090b23015fb580555cc1da8 Mon Sep 17 00:00:00 2001 From: Juho Ylikorpi Date: Wed, 27 Jul 2022 15:57:24 +0300 Subject: [PATCH] Fixes #9789: Fix svg width calculation --- netbox/dcim/svg/cables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/svg/cables.py b/netbox/dcim/svg/cables.py index f9c614b67..653a291c7 100644 --- a/netbox/dcim/svg/cables.py +++ b/netbox/dcim/svg/cables.py @@ -178,7 +178,7 @@ class CableTraceSVG: """ 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): node = Node( position=(i * width, self.cursor), @@ -197,7 +197,7 @@ class CableTraceSVG: """ nodes = [] 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): node = Node(