Skip to content

Commit

Permalink
feat: labels positions are placed the same X,Y that were in the previ…
Browse files Browse the repository at this point in the history
…ous diagrams version
  • Loading branch information
tsypuk committed Jan 20, 2024
1 parent 8d188ae commit 6d2185d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions multicloud_diagrams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def read_coords_from_file(self, file_name: str):
cords['width'] = data.get('width')
self.prev_coords[neighbor.get('id')] = cords

elif neighbor.get('id').startswith("label:"):
elif neighbor.get('id').startswith("label"):
data = neighbor.find('mxGeometry')
mx_point = data.find('mxPoint')
cords = {}
Expand Down Expand Up @@ -641,8 +641,15 @@ def read_uml_from_file(self, file_name, edge_style=None, label_style=None):
self.add_layer('actors')
self.extract_messages_from_uml(sequence_diagram, actors=actors, participants=participants, layer_name=base_name, edge_style=edge_style, label_style=label_style)

# set coords for all labels
for mxLabel in self.root:
if mxLabel.attrib['id'].startswith('label'):
data = mxLabel.find('mxGeometry')
mx_point = data.find('mxPoint')
self.update_vertex_coords_from_prev_version(mx_point, mxLabel.attrib['id'])

def add_note_to_existing_edge(self, current_note, prev_edge, prefix=None):
if (prefix):
if prefix:
id = prev_edge.attrib['id'].replace(f'edge_{prefix}:', '')
for mxLabel in self.root:
if mxLabel.attrib['id'] == f'label_{prefix}:{id}':
Expand Down

0 comments on commit 6d2185d

Please sign in to comment.