diff --git a/capellambse/aird/_edge_factories.py b/capellambse/aird/_edge_factories.py index 36f5dc81..e3823932 100644 --- a/capellambse/aird/_edge_factories.py +++ b/capellambse/aird/_edge_factories.py @@ -317,10 +317,14 @@ def snap_oblique( ) delta = (points[i] - source).angleto(new_point - source) if abs(delta) >= 1: + if len(points) >= 3: + next_point = points[next_i - i + next_i] + else: + next_point = source new_point = target.vector_snap( source, style=diagram.RoutingStyle.OBLIQUE, - source=points[next_i - i + next_i], + source=next_point, ) points[i] = new_point 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_: