diff options
author | jaseg <git@jaseg.de> | 2023-04-22 17:16:20 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-22 17:16:20 +0200 |
commit | a93d118773818fbd47af4965d7b37e1b10bdf9b6 (patch) | |
tree | 528a06ac8154dfa70caa8714e7aa5ea62a51dd9f /gerbonara/utils.py | |
parent | 5ce88e4d1b06dcc846c94ec614fb00f64e85c125 (diff) | |
download | gerbonara-a93d118773818fbd47af4965d7b37e1b10bdf9b6.tar.gz gerbonara-a93d118773818fbd47af4965d7b37e1b10bdf9b6.tar.bz2 gerbonara-a93d118773818fbd47af4965d7b37e1b10bdf9b6.zip |
kicad unit tests WIP
Diffstat (limited to 'gerbonara/utils.py')
-rw-r--r-- | gerbonara/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gerbonara/utils.py b/gerbonara/utils.py index e33a7bf..933b3ca 100644 --- a/gerbonara/utils.py +++ b/gerbonara/utils.py @@ -292,6 +292,10 @@ class Tag: own implementation by passing a ``tag`` parameter. """ def __init__(self, name, children=None, root=False, **attrs): + if (fill := attrs.get('fill')) and isinstance(fill, tuple): + attrs['fill'], attrs['fill-opacity'] = fill + if (stroke := attrs.get('stroke')) and isinstance(stroke, tuple): + attrs['stroke'], attrs['stroke-opacity'] = stroke self.name, self.attrs = name, attrs self.children = children or [] self.root = root |