From 8055c0e47235df9ebe5c2c495cc499c122e9bb3d Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Sat, 7 Nov 2020 20:47:55 +0000 Subject: [PATCH] apply edge label colors to all 3 potential labels --- pyyed/__init__.py | 18 +++++++++--------- setup.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyyed/__init__.py b/pyyed/__init__.py index e827971..2ca8659 100644 --- a/pyyed/__init__.py +++ b/pyyed/__init__.py @@ -324,22 +324,22 @@ def convert(self): ET.SubElement(pl, "y:LineStyle", color=self.color, type=self.line_type, width=self.width) - if self.label: - args = {} - if self.label_background_color: - args["backgroundColor"] = self.label_background_color - if self.label_border_color: - args["lineColor"] = self.label_border_color + label_color_args = {} + if self.label_background_color: + label_color_args["backgroundColor"] = self.label_background_color + if self.label_border_color: + label_color_args["lineColor"] = self.label_border_color - ET.SubElement(pl, "y:EdgeLabel", **args).text = self.label + if self.label: + ET.SubElement(pl, "y:EdgeLabel", **label_color_args).text = self.label if self.source_label: ET.SubElement(pl, "y:EdgeLabel", modelName="six_pos", modelPosition="shead", - preferredPlacement="source_on_edge").text = self.source_label + preferredPlacement="source_on_edge", **label_color_args).text = self.source_label if self.target_label: ET.SubElement(pl, "y:EdgeLabel", modelName="six_pos", modelPosition="ttail", - preferredPlacement="target_on_edge").text = self.target_label + preferredPlacement="target_on_edge", **label_color_args).text = self.target_label return edge diff --git a/setup.py b/setup.py index 9ab4107..a3669c3 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup(name='pyyed', - version='1.4.0', + version='1.4.1', description='A simple Python library to export graphs to the yEd graph editor', author='James Scott-Brown',