From 93f09cef24ec411be0b536e20104a713a8ec0844 Mon Sep 17 00:00:00 2001 From: huyenngn Date: Mon, 16 Sep 2024 22:11:48 +0200 Subject: [PATCH] fix: Don't draw port labels twice --- capellambse/svg/drawing.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/capellambse/svg/drawing.py b/capellambse/svg/drawing.py index c2cc499e..1db6fcaf 100644 --- a/capellambse/svg/drawing.py +++ b/capellambse/svg/drawing.py @@ -555,18 +555,20 @@ def _draw_symbol( labels=floating_labels_, id_=id_, ) - else: - gcls = "".join(f" context-{i}" for i in context_) - grp = self.__drawing.g(class_=f"Box {class_}{gcls}", id_=id_) - grp.add( - self.__drawing.use( - href=f"#{class_}Symbol", - insert=pos, - size=size, - class_=class_, - **obj_style._to_dict(), - ) + self.__drawing.add(grp) + return + + gcls = "".join(f" context-{i}" for i in context_) + grp = self.__drawing.g(class_=f"Box {class_}{gcls}", id_=id_) + grp.add( + self.__drawing.use( + href=f"#{class_}Symbol", + insert=pos, + size=size, + class_=class_, + **obj_style._to_dict(), ) + ) self.__drawing.add(grp) if floating_labels_: